Sample code for 30+ languages & platforms
Rust

MD4 Hash a String

See more Encryption Examples

MD4 hash a string.

Chilkat Rust Downloads

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

let crypt = chilkat::Crypt2::new();

let content = "The quick brown fox jumps over the lazy dog".to_string();

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

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

let hash_str = crypt.hash_string_enc(&content).unwrap_or_default();

println!("{}", hash_str);

// The output is:
// 1BEE69A46BA811185C194762ABAEAE90