15 unstable releases

Uses new Rust 2024

0.11.0-rc.2 Feb 2, 2026
0.10.2 Oct 5, 2022
0.10.1 Feb 17, 2022
0.10.0 Dec 7, 2021
0.1.2 Jan 20, 2017

#2950 in Cryptography

Download history 7943/week @ 2025-10-21 6362/week @ 2025-10-28 5668/week @ 2025-11-04 15439/week @ 2025-11-11 13411/week @ 2025-11-18 8937/week @ 2025-11-25 5936/week @ 2025-12-02 7549/week @ 2025-12-09 10549/week @ 2025-12-16 3609/week @ 2025-12-23 4466/week @ 2025-12-30 11982/week @ 2026-01-06 8601/week @ 2026-01-13 10945/week @ 2026-01-20 12203/week @ 2026-01-27 17355/week @ 2026-02-03

51,693 downloads per month
Used in 38 crates (19 directly)

MIT/Apache

11KB
155 lines

RustCrypto: MD2

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of the MD2 cryptographic hash algorithm.

Examples

use md2::{Md2, Digest};
use hex_literal::hex;

let mut hasher = Md2::new();
hasher.update(b"hello world");
let hash = hasher.finalize();

assert_eq!(hash, hex!("d9cce882ee690a5c1ce70beff3a78c77"));

// Hex-encode hash using https://docs.rs/base16ct
let hex_hash = base16ct::lower::encode_string(&hash);
assert_eq!(hex_hash, "d9cce882ee690a5c1ce70beff3a78c77");

Also, see the examples section in the RustCrypto/hashes readme.

License

The crate is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~715KB
~18K SLoC