aboutsummaryrefslogtreecommitdiff
path: root/hex.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-09 01:14:10 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-09 01:14:10 +0100
commitad7fb045add90c3e4b3b7abe2a20eea3d05cfb1d (patch)
treed8391ddb2fbf7eeb1136f0ace915b079c77eff3c /hex.h
parente0fc222f1d3dc1a6672bdbbd7009b08cfd49d776 (diff)
downloadslcl-ad7fb045add90c3e4b3b7abe2a20eea3d05cfb1d.tar.gz
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.
Diffstat (limited to 'hex.h')
-rw-r--r--hex.h9
1 files changed, 9 insertions, 0 deletions
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 <stddef.h>
+
+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 */