Sample code for 30+ languages & platforms
DataFlex

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoCrypt
    String sContent
    String sHashStr

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

    Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt
    If (Not(IsComObjectCreated(hoCrypt))) Begin
        Send CreateComObject of hoCrypt
    End

    Move "The quick brown fox jumps over the lazy dog" To sContent

    // The desired output is a hexidecimal string:
    Set ComEncodingMode Of hoCrypt To "hex"

    // Set the hash algorithm:
    Set ComHashAlgorithm Of hoCrypt To "md4"

    Get ComHashStringENC Of hoCrypt sContent To sHashStr

    Showln sHashStr

    // The output is:
    // 1BEE69A46BA811185C194762ABAEAE9


End_Procedure