diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-08-10 07:54:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-10 17:09:54 (GMT) |
commit | 94c29976d0020b48a5c565234b71f8f6abaf08be (patch) | |
tree | 359a7e0819b8dc5d9d4b2d45b8edd085f8b8777b /Source/cmCryptoHash.h | |
parent | ee9d4feb67f01686c270d3db584dfccaefd14b47 (diff) | |
download | CMake-94c29976d0020b48a5c565234b71f8f6abaf08be.zip CMake-94c29976d0020b48a5c565234b71f8f6abaf08be.tar.gz CMake-94c29976d0020b48a5c565234b71f8f6abaf08be.tar.bz2 |
cmCryptoHash: Documentation comments
Diffstat (limited to 'Source/cmCryptoHash.h')
-rw-r--r-- | Source/cmCryptoHash.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 6aaaf93..84dea9b 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -16,12 +16,26 @@ #include <cm_auto_ptr.hxx> +/** + * @brief Abstract base class for cryptographic hash generators + */ class cmCryptoHash { public: virtual ~cmCryptoHash() {} + /// @brief Returns a new hash generator of the requested type + /// @arg algo Hash type name. Supported hash types are + /// MD5, SHA1, SHA224, SHA256, SHA384, SHA512 + /// @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 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); + /// @brief Calculates a hash string from file content + /// @see HashString() + /// @return Non empty hash string if the file was read successfully. + /// An empty string otherwise. std::string HashFile(const std::string& file); protected: |