summaryrefslogtreecommitdiffstats
path: root/Source/cmCryptoHash.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2016-08-10 08:35:19 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-10 17:09:55 (GMT)
commit74f0d4abcd8de84283858fe144772e688669e46a (patch)
treefedbfac78b8cf4af4e6c7eeb0500637ebfd4d32a /Source/cmCryptoHash.h
parent94c29976d0020b48a5c565234b71f8f6abaf08be (diff)
downloadCMake-74f0d4abcd8de84283858fe144772e688669e46a.zip
CMake-74f0d4abcd8de84283858fe144772e688669e46a.tar.gz
CMake-74f0d4abcd8de84283858fe144772e688669e46a.tar.bz2
cmCryptoHash: New byte hash to string function
Diffstat (limited to 'Source/cmCryptoHash.h')
-rw-r--r--Source/cmCryptoHash.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 84dea9b..80ab269 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -29,6 +29,13 @@ public:
/// @return A valid auto pointer if algo is supported or
/// an invalid/NULL pointer otherwise
static CM_AUTO_PTR<cmCryptoHash> New(const char* algo);
+ /// @brief Converts a hex character to its binary value (4 bits)
+ /// @arg input Hex character [0-9a-fA-F].
+ /// @arg output Binary value of the input character (4 bits)
+ /// @return True if input was a valid hex character
+ static bool IntFromHexDigit(char input, char& output);
+ /// @brief Converts a byte hash to a sequence of hex character pairs
+ static std::string ByteHashToString(const std::vector<unsigned char>& hash);
/// @brief Calculates a hash string from string input data
/// @return Sequence of hex characters pairs for each byte of the binary hash
std::string HashString(const std::string& input);