From 65fb25fa0e9d88e0ccd69f0c42653def1fda5ff1 Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Wed, 8 Jul 2015 01:22:12 +0200 Subject: [PATCH] added _hex2bin() --- include/pcp/util.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/pcp/util.h b/include/pcp/util.h index 37aa957..843dddf 100644 --- a/include/pcp/util.h +++ b/include/pcp/util.h @@ -107,7 +107,13 @@ void _dump(char *n, byte *d, size_t s); */ char *_bin2hex(byte *bin, size_t len); - +/** convert hex string to binary date + \param[in] hex_str hex string + \param[out] byte_array output buffer (malloc'd to byte_array_max) + \param[in] byte_array_max max size allowed for output buffer + \return Returns size of output buffer +*/ +size_t _hex2bin(const char *hex_str, unsigned char *byte_array, size_t byte_array_max); #endif /* _HAVE_PCP_UTIL_H */