Crate tenthash

Source
Expand description

TentHash is a high-quality, non-cryptographic, 160-bit hash function. It is also portable, easy to implement, and reasonably fast.

TentHash’s target applications are data fingerprinting, content-addressable systems, and other use cases that don’t tolerate hash collisions.

Importantly, TentHash is explicitly not intended to stand up to attacks, and should never be used where the choice of hash function has security considerations. Its robustness against collisions is only meaningful under non-adversarial conditions. In other words, like a good tent, it will protect you from the elements, but will do very little to protect you from attackers.

§Example

let hash = tenthash::hash("Hello world!");

assert_eq!(&hash[..4], &[0x15, 0x5f, 0xa, 0x35]);

Structs§

TentHash
Computes TentHash incrementally, taking input data in chunks.

Traits§

DigestExt
A helper trait with convenience methods for TentHash’s output digest.

Functions§

hash
Computes TentHash in one go for a contiguous slice of data.