diff options
-rw-r--r-- | src/codec/hex/hex.cpp | 8 | ||||
-rw-r--r-- | src/codec/hex/hex.h | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/codec/hex/hex.cpp b/src/codec/hex/hex.cpp index 6cef71fec..8efdd3ccd 100644 --- a/src/codec/hex/hex.cpp +++ b/src/codec/hex/hex.cpp @@ -34,6 +34,14 @@ void hex_encode(char output[], } } +std::string hex_encode(const MemoryRegion<byte>& input, + bool uppercase) + { + return hex_encode(&input[0], + input.size(), + uppercase); + } + std::string hex_encode(const byte input[], u32bit input_length, bool uppercase) diff --git a/src/codec/hex/hex.h b/src/codec/hex/hex.h index 91a743b45..afef1ec84 100644 --- a/src/codec/hex/hex.h +++ b/src/codec/hex/hex.h @@ -37,6 +37,15 @@ std::string BOTAN_DLL hex_encode(const byte input[], bool uppercase = true); /** +* Perform hex encoding +* @param input some input +* @param uppercase should output be upper or lower case? +* @return hexadecimal representation of input +*/ +std::string BOTAN_DLL hex_encode(const MemoryRegion<byte>& input, + bool uppercase = true); + +/** * Perform hex decoding * @param output an array of at least input_length/2 bytes * @param input some hex input |