Sample code for 30+ languages & platforms
JavaScript

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

var crypt = new CkCrypt2();

var content = "The quick brown fox jumps over the lazy dog";

// The desired output is a hexidecimal string:
crypt.EncodingMode = "hex";

// Set the hash algorithm:
crypt.HashAlgorithm = "md4";

var hashStr;
hashStr = crypt.HashStringENC(content);

console.log(hashStr);

// The output is:
// 1BEE69A46BA811185C194762ABAEAE9