1 #ifndef _HEXIFY_H_
2 #define _HEXIFY_H_
3 
4 #include <stddef.h>
5 #include <stdint.h>
6 
7 /**
8  * hexify(in, out, len):
9  * Convert ${len} bytes from ${in} into hexadecimal, writing the resulting
10  * 2 * ${len} bytes to ${out}; and append a NUL byte.
11  */
12 void hexify(const uint8_t *, char *, size_t);
13 
14 /**
15  * unhexify(in, out, len):
16  * Convert 2 * ${len} hexadecimal characters from ${in} to ${len} bytes
17  * and write them to ${out}.  This function will only fail if the input is
18  * not a sequence of hexadecimal characters.
19  */
20 int unhexify(const char *, uint8_t *, size_t);
21 
22 #endif /* !_HEXIFY_H_ */
23