Sample code for 30+ languages & platforms
Delphi DLL

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Crypt2;

...

procedure TForm1.Button1Click(Sender: TObject);
var
crypt: HCkCrypt2;
content: PWideChar;
hashStr: PWideChar;

begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

crypt := CkCrypt2_Create();

content := 'The quick brown fox jumps over the lazy dog';

// The desired output is a hexidecimal string:
CkCrypt2_putEncodingMode(crypt,'hex');

// Set the hash algorithm:
CkCrypt2_putHashAlgorithm(crypt,'md4');

hashStr := CkCrypt2__hashStringENC(crypt,content);

Memo1.Lines.Add(hashStr);

// The output is:
// 1BEE69A46BA811185C194762ABAEAE9

CkCrypt2_Dispose(crypt);

end;