diff options
author | Brad King <brad.king@kitware.com> | 2008-01-24 19:41:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-24 19:41:18 (GMT) |
commit | 1dec54489afdaf418175d3a86b6e0edca349fb3b (patch) | |
tree | 73de1b507896285ba103cbbda4e2dab8c705aab3 /Source/cmSystemTools.cxx | |
parent | 02b1767e429ed986a851a7238dbca0e306ff1c5f (diff) | |
download | CMake-1dec54489afdaf418175d3a86b6e0edca349fb3b.zip CMake-1dec54489afdaf418175d3a86b6e0edca349fb3b.tar.gz CMake-1dec54489afdaf418175d3a86b6e0edca349fb3b.tar.bz2 |
ENH: Add cmSystemTools::ComputeStringMD5 method.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index b489c48..89961da 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1129,6 +1129,17 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out) #endif } +std::string cmSystemTools::ComputeStringMD5(const char* input) +{ + char md5out[32]; + cmsysMD5* md5 = cmsysMD5_New(); + cmsysMD5_Initialize(md5); + cmsysMD5_Append(md5, reinterpret_cast<unsigned char const*>(input), -1); + cmsysMD5_FinalizeHex(md5, md5out); + cmsysMD5_Delete(md5); + return std::string(md5out, 32); +} + void cmSystemTools::Glob(const char *directory, const char *regexp, std::vector<std::string>& files) { |