summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.h
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2017-07-08 18:42:02 +0200
committerAndré Klitzing <aklitzing@gmail.com>2017-07-14 08:57:17 +0200
commitc4647d84321f4a7b52301237394087065f5df33c (patch)
tree7fb689a0052667a611020e9d9169afa2160b1ba5 /Source/cmSystemTools.h
parent501a4feea8d0d007ce292defec1c97d6eb702409 (diff)
downloadcmake-c4647d84321f4a7b52301237394087065f5df33c.tar.gz
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.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 9de7967287..e163c91570 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);