sources/md5.cpp

changeset 182
20ca0a6be175
parent 88
08ccaf26cffd
--- a/sources/md5.cpp	Wed Jan 27 13:17:11 2021 +0200
+++ b/sources/md5.cpp	Wed Jan 27 14:04:53 2021 +0200
@@ -306,4 +306,12 @@
 	}
 }
 
+std::string md5(const char *buffer)
+{
+	char checksum[33];
+	CalculateMD5(reinterpret_cast<const unsigned char*>(buffer), strlen(buffer), checksum);
+	checksum[sizeof checksum - 1] = '\0';
+	return {checksum};
+}
+
 END_ZFC_NAMESPACE
\ No newline at end of file

mercurial