Crate tenthash

source ·
Expand description

TentHash is a robust 160-bit non-cryptographic hash function.

WARNING: TentHash’s design is not yet finalized, and digest results may change before 1.0 is declared.

TentHash is intended to be used as a reasonably fast but (more importantly) high-quality checksum for data identification. Moreover, it has a simple design that is easy to understand and straightforward to write conforming implementations of.

TentHash is explicitly not intended to stand up to attacks. Its otherwise strong collision resistance 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.

This implementation should work on platforms of any endianness, but has only been tested on little endian platforms so far. Running the test suite on a big-endian platform can verify.

§Example

let mut hasher = TentHasher::new();
hasher.update("Hello world!");
let hash = hasher.finalize();

assert_eq!(&hash[..4], &[0x30, 0xd0, 0x8a, 0x79]);

Structs§

  • The TentHash hasher. Processes input bytes and outputs a TentHash digest.