Unicode C++
Unicode C++
MD4 Hash a String
See more Encryption Examples
MD4 hash a string.Chilkat Unicode C++ Downloads
#include <CkCrypt2W.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkCrypt2W crypt;
const wchar_t *content = L"The quick brown fox jumps over the lazy dog";
// The desired output is a hexidecimal string:
crypt.put_EncodingMode(L"hex");
// Set the hash algorithm:
crypt.put_HashAlgorithm(L"md4");
const wchar_t *hashStr = 0;
hashStr = crypt.hashStringENC(content);
wprintf(L"%s\n",hashStr);
// The output is:
// 1BEE69A46BA811185C194762ABAEAE9
}