diff options
author | Alexander Færøy <ahf@0x90.dk> | 2016-10-16 13:20:14 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2016-10-22 20:36:50 +0200 |
commit | da67d3e8e69eb5fb702a3dd39356d38a1ee9d8cd (patch) | |
tree | b3faa43fd92fd001e09ce5b5007330e7bf669dae /src/core/misc.h | |
parent | 6300dfec71d376c96351708f76a6c4ee4a187eb5 (diff) | |
download | irssi-da67d3e8e69eb5fb702a3dd39356d38a1ee9d8cd.zip |
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.
Diffstat (limited to 'src/core/misc.h')
-rw-r--r-- | src/core/misc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/misc.h b/src/core/misc.h index c095e131..00637da0 100644 --- a/src/core/misc.h +++ b/src/core/misc.h @@ -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 |