From ad7fb045add90c3e4b3b7abe2a20eea3d05cfb1d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 9 Mar 2023 01:14:10 +0100 Subject: Move decode_hex into its own file - Error detection against strotul(3) has been improved, as done in other places. - New function encode_hex has been implemented, which will be used by future commits. --- hex.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 hex.h (limited to 'hex.h') diff --git a/hex.h b/hex.h new file mode 100644 index 0000000..2195415 --- /dev/null +++ b/hex.h @@ -0,0 +1,9 @@ +#ifndef HEX_H +#define HEX_H + +#include + +int hex_encode(const void *buf, char *hex, size_t buflen, size_t hexlen); +int hex_decode(const char *hex, void *buf, size_t n); + +#endif /* HEX_H */ -- cgit v1.2.3