Crate ahash[][src]

aHash

This hashing algorithm is intended to be a high performance, (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. aHash is not a cryptographically secure hash.

Structs

AHasher

A Hasher for hashing an arbitrary stream of bytes.

RandomState

Provides a Hasher factory. This is typically used (e.g. by HashMap) to create AHashers in order to hash the keys of the map. See build_hasher below.

Traits

CallHasher

Provides a way to get an optimized hasher for a given data type. Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash for a specific type. So this may be faster for primitive types. It does however consume the hasher in the process. #Example