Add function to convert a buffer to a colon-delimited hex string.

This patch adds binary_to_hex(), which can take an input buffer and
convert it to colon-delimited hex strings suitable for printing for
fingerprints.
This commit is contained in:
Alexander Færøy 2016-10-16 13:20:14 +02:00
commit da67d3e8e6
No known key found for this signature in database
GPG key ID: E15081D5D3C3DB53
2 changed files with 24 additions and 0 deletions

View file

@ -109,4 +109,8 @@ int find_substr(const char *list, const char *item);
/* split `str' into `len' sized substrings */
char **strsplit_len(const char *str, int len, gboolean onspace);
/* Convert a given buffer to a printable, colon-delimited, hex string and
* return a pointer to the newly allocated buffer */
char *binary_to_hex(unsigned char *buffer, size_t size);
#endif