diff options
author | Brad King <brad.king@kitware.com> | 2016-11-03 17:45:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-03 17:45:29 (GMT) |
commit | 5cb1b345d932d3e0dc34a2d423894a59a6c8db35 (patch) | |
tree | e65b51405aeffee8b4ca00523fe450c76cf3aec0 /Utilities/cmlibrhash/librhash/hex.h | |
parent | 798b0adc628ab16dbb4d04ef444b8e7db4f5cffa (diff) | |
parent | 1367fccc330b0ff314845aeb3547bbc38486913a (diff) | |
download | CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.zip CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.tar.gz CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.tar.bz2 |
Merge branch 'upstream-librhash' into import-librhash
* upstream-librhash:
librhash 2016-11-01 (d839a1a8)
Diffstat (limited to 'Utilities/cmlibrhash/librhash/hex.h')
-rw-r--r-- | Utilities/cmlibrhash/librhash/hex.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Utilities/cmlibrhash/librhash/hex.h b/Utilities/cmlibrhash/librhash/hex.h new file mode 100644 index 0000000..2b365e2 --- /dev/null +++ b/Utilities/cmlibrhash/librhash/hex.h @@ -0,0 +1,25 @@ +/* hex.h - conversion for hexadecimal and base32 strings. */ +#ifndef HEX_H +#define HEX_H + +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void rhash_byte_to_hex(char *dest, const unsigned char *src, unsigned len, int upper_case); +void rhash_byte_to_base32(char* dest, const unsigned char* src, unsigned len, int upper_case); +void rhash_byte_to_base64(char* dest, const unsigned char* src, unsigned len); +char* rhash_print_hex_byte(char *dest, const unsigned char byte, int upper_case); +int rhash_urlencode(char *dst, const char *name); +int rhash_sprintI64(char *dst, uint64_t number); + +#define BASE32_LENGTH(bytes) (((bytes) * 8 + 4) / 5) +#define BASE64_LENGTH(bytes) ((((bytes) + 2) / 3) * 4) + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* HEX_H */ |