diff options
author | André Klitzing <aklitzing@gmail.com> | 2017-07-08 16:42:02 (GMT) |
---|---|---|
committer | André Klitzing <aklitzing@gmail.com> | 2017-07-14 06:57:17 (GMT) |
commit | c4647d84321f4a7b52301237394087065f5df33c (patch) | |
tree | 7fb689a0052667a611020e9d9169afa2160b1ba5 /Source/cmSystemTools.h | |
parent | 501a4feea8d0d007ce292defec1c97d6eb702409 (diff) | |
download | CMake-c4647d84321f4a7b52301237394087065f5df33c.zip CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.gz CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.bz2 |
Change ComputeFileMD5 to ComputeFileHash
* Use a parameter to select hash algorithm
* Return a std::string as result or an empty
string if it fails
* Avoids unnecessary copy of hash value
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9de7967..e163c91 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" +#include "cmCryptoHash.h" #include "cmProcessOutput.h" #include "cmsys/Process.h" #include "cmsys/SystemTools.hxx" // IWYU pragma: export @@ -179,8 +180,9 @@ public: if possible). */ static bool RenameFile(const char* oldname, const char* newname); - ///! Compute the md5sum of a file - static bool ComputeFileMD5(const std::string& source, char* md5out); + ///! Compute the hash of a file + static std::string ComputeFileHash(const std::string& source, + cmCryptoHash::Algo algo); /** Compute the md5sum of a string. */ static std::string ComputeStringMD5(const std::string& input); |