Sample code for 30+ languages & platforms
Java

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.Crypt2;

public class ChilkatExample {

    public static void main(String[] args) {
        // This example assumes the Chilkat API to have been previously unlocked.
        // See Global Unlock Sample for sample code.

        Crypt2 crypt = new Crypt2();

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

        // The desired output is a hexidecimal string:
        crypt.setEncodingMode("hex");

        // Set the hash algorithm:
        crypt.setHashAlgorithm("md4");

        String hashStr = crypt.hashStringENC(content);

        System.out.println(hashStr);

        // The output is:
        // 1BEE69A46BA811185C194762ABAEAE90
    }
}