From eddc0ffdab239c61cc0e064b6ebd33dfadcef3cd Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 24 Aug 2023 03:04:58 +0200 Subject: Lib: Add functions for reading and writing of bytestrings Based on patch from Alexander Zubkov, thanks! --- lib/string.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/string.h') diff --git a/lib/string.h b/lib/string.h index 2829943d..161b7651 100644 --- a/lib/string.h +++ b/lib/string.h @@ -33,6 +33,9 @@ u64 bstrtoul10(const char *str, char **end); u64 bstrtoul16(const char *str, char **end); byte bstrtobyte16(const char *str); +int bstrhextobin(const char *s, byte *b); +int bstrbintohex(const byte *b, size_t len, char *buf, size_t size, char delim); + int patmatch(const byte *pat, const byte *str); static inline char *xbasename(const char *str) -- cgit v1.2.3