[][src]Crate ahash


This hashing algorithm is intended to be a high perfromance, (hardware specific), keyed hash function. This can be seen as a DOS resistant alternative to FxHash, or a fast equivalent to SipHash. It provides a high speed hash algorithm, but where the result is not predictable without knowing a Key. This allows it to be used in a HashMap without allowing for the possibility that an malicious user can induce a collision.

How aHash works

aHash uses the hardware AES instruction on x86 processors to provide a keyed hash function. It uses two rounds of AES per hash. So it should not be considered cryptographically secure.



A Hasher for hashing an arbitrary stream of bytes.


Provides a BuildHasher is typically used (e.g. by HashMap) to create AHashers for each key such that they are hashed independently of one another, since AHashers contain state.

Type Definitions


A HashMap using a LocationBasedState BuildHasher to hash the items.