summaryrefslogtreecommitdiff
path: root/src/basic/util.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-10 14:38:19 +0200
committerTom Gundersen <teg@jklm.no>2015-07-14 22:14:08 +0200
commit919a7f5f1c4f1a4c3e20b0dc55143b8ad70e6a70 (patch)
tree8125479756bfc9c64743918486f496077421f8be /src/basic/util.h
parent50f1e641a93cacfc693b0c3d300bee5df0c8c460 (diff)
basic: util - add base32hexmem() function similar to hexmem()
This implements more of RFC4648.
Diffstat (limited to 'src/basic/util.h')
-rw-r--r--src/basic/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h
index dae43006e4..c2e5cc610b 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -240,6 +240,8 @@ char octchar(int x) _const_;
int unoctchar(char c) _const_;
char decchar(int x) _const_;
int undecchar(char c) _const_;
+char base32hexchar(int x) _const_;
+int unbase32hexchar(char c) _const_;
char base64char(int x) _const_;
int unbase64char(char c) _const_;
@@ -618,6 +620,9 @@ static inline void *mempset(void *s, int c, size_t n) {
char *hexmem(const void *p, size_t l);
int unhexmem(const char *p, size_t l, void **mem, size_t *len);
+char *base32hexmem(const void *p, size_t l, bool padding);
+int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *len);
+
char *base64mem(const void *p, size_t l);
int unbase64mem(const char *p, size_t l, void **mem, size_t *len);