Expand description

An implementation of the RIPEMD cryptographic hash.

This crate implements only the modified 1996 versions, not the original one from 1992.

Note that RIPEMD-256 provides only the same security as RIPEMD-128, and RIPEMD-320 provides only the same security as RIPEMD-160.


use hex_literal::hex;
use ripemd::{Ripemd160, Ripemd320, Digest};

// create a RIPEMD-160 hasher instance
let mut hasher = Ripemd160::new();

// process input message
hasher.update(b"Hello world!");

// acquire hash digest in the form of GenericArray,
// which in this case is equivalent to [u8; 20]
let result = hasher.finalize();
assert_eq!(result[..], hex!("7f772647d88750add82d8e1a7a3e5c0902a346a3"));

// same for RIPEMD-320
let mut hasher = Ripemd320::new();
hasher.update(b"Hello world!");
let result = hasher.finalize();
assert_eq!(&result[..], &hex!("

Also see RustCrypto/hashes readme.


pub use digest;


Core block-level RIPEMD-160 hasher state.

Core block-level RIPEMD-256 hasher state.

Core block-level RIPEMD-320 hasher state.


Convinience wrapper trait covering functionality of cryptographic hash functions with fixed output size.

Type Definitions

RIPEMD-160 hasher.

RIPEMD-256 hasher.

RIPEMD-320 hasher.