From f7548d6d28c313cf80e6f3ef89aed16a19815df1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:51:24 +0200 Subject: Adding upstream version 1:2.3.19.1+dfsg1. Signed-off-by: Daniel Baumann --- src/lib/hex-binary.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/lib/hex-binary.h (limited to 'src/lib/hex-binary.h') diff --git a/src/lib/hex-binary.h b/src/lib/hex-binary.h new file mode 100644 index 0000000..24c3a39 --- /dev/null +++ b/src/lib/hex-binary.h @@ -0,0 +1,15 @@ +#ifndef HEX_BINARY_H +#define HEX_BINARY_H + +/* Convert binary to hex digits allocating return value from data stack */ +const char *binary_to_hex(const unsigned char *data, size_t size); +const char *binary_to_hex_ucase(const unsigned char *data, size_t size); + +void binary_to_hex_append(string_t *dest, const unsigned char *data, + size_t size); + +/* Convert hex to binary. data and dest may point to same value. + Returns 0 if all ok, -1 if data is invalid. */ +int hex_to_binary(const char *data, buffer_t *dest); + +#endif -- cgit v1.2.3