Crate tenthash

source
Expand description

TentHash, a 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 a high-quality, reasonably fast, large-output hash. Its target applications are data fingerprinting, checksums, content-addressable systems, and other use cases that don’t tolerate hash collisions.

Importantly, TentHash is explicitly not intended to stand up to attacks. 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.

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 hash = tenthash::hash("Hello world!");

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

Structs§

  • A streaming hasher, for processing data in progressive chunks.

Functions§

  • Computes the hash of a piece of data.