diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-02 12:47:10 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-02 12:47:10 +0000 |
commit | 15f18d0c0c326dc789c2af1715fefecb01abfcce (patch) | |
tree | cd6dd6ab03ac94aae105b2535e7cac4e2db565a6 /src/libutil/str_util.h | |
parent | 91001260bc87b72668381b3a8536b76f93bac26a (diff) | |
download | rspamd-15f18d0c0c326dc789c2af1715fefecb01abfcce.tar.gz rspamd-15f18d0c0c326dc789c2af1715fefecb01abfcce.zip |
Add hex encoding/decoding routines
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r-- | src/libutil/str_util.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h index da794bc16..03798c80e 100644 --- a/src/libutil/str_util.h +++ b/src/libutil/str_util.h @@ -125,6 +125,22 @@ gchar * rspamd_encode_base32 (const guchar *in, gsize inlen); guchar* rspamd_decode_base32 (const gchar *in, gsize inlen, gsize *outlen); /** + * Encode string using hex encoding + * @param in input + * @param inlen input length + * @return freshly allocated base32 encoding of a specified string + */ +gchar * rspamd_encode_hex (const guchar *in, gsize inlen); + +/** + * Decode string using hex encoding + * @param in input + * @param inlen input length + * @return freshly allocated base32 decoded value or NULL if input is invalid + */ +guchar* rspamd_decode_hex (const gchar *in, gsize inlen); + +/** * Encode string using base64 encoding * @param in input * @param inlen input length |