Sample code for 30+ languages & platforms
Tcl

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

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

set crypt [new_CkCrypt2]

set content "The quick brown fox jumps over the lazy dog"

# The desired output is a hexidecimal string:
CkCrypt2_put_EncodingMode $crypt "hex"

# Set the hash algorithm:
CkCrypt2_put_HashAlgorithm $crypt "md4"

set hashStr [CkCrypt2_hashStringENC $crypt $content]

puts "$hashStr"

# The output is:
# 1BEE69A46BA811185C194762ABAEAE9

delete_CkCrypt2 $crypt