Sample code for 30+ languages & platforms
CkPython

MD5 Hash a String

MD5 hash a string.

Chilkat CkPython Downloads

CkPython
import chilkat

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

crypt = chilkat.CkCrypt2()

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

# The desired output is a hexidecimal string:
crypt.put_EncodingMode("hex")

# Set the hash algorithm:
crypt.put_HashAlgorithm("md5")

hashStr = crypt.hashStringENC(content)

print(hashStr)

# The output is:
# 9E107D9D372BB6826BD81D3542A419D6