Expand description
lanehash: fast non-cryptographic 64/128-bit hashing, two functions with one API.
The crate root is lanehash itself, the default choice: chained NH-32 stripes
(spec, 65 bytes and up) and a multiply-fold short path (short, 0–64 bytes), no
instruction-set requirement, one definition reproduced bit-for-bit by the scalar
reference and the SSE2, AVX2, AVX-512, NEON and wasm simd128 backends. The original
AES-lane function lives in aes with the same shape of API; it is faster only in
bulk on machines with VAES.
Public API: hash64, hash128, Keyed for many inputs under one seed,
Stream for incremental hashing, and FixedState / RandomState for HashMap. The hidden modules are implementation
detail, kept public for the reference tests and the benchmark harness.
Modules§
- aes
- The AES-lane function (SMHasher
lanehash_aes64): AES lanes over 64 bytes (AES-NI / VAES / NEON at runtime, T-table software AES otherwise), a multiply-fold path below.specis the definition; every backend equals it. Faster than the crate root only in bulk on machines with VAES.
Structs§
- Fixed
State BuildHasherwith a fixed seed (deterministic maps).- Keyed
- A seed with its secrets computed once, for hashing many inputs under one seed:
Keyed::new(seed).hash64(b) == hash64(b, seed)without the seed multiply per call. - Lane
Hasher - Random
State BuildHasherwith a per-process random seed and a different accumulator start for every instance, so two maps do not share bucket order.- Stream
Functions§
- hash64
- 64-bit lanehash of
bytesunderseed. - hash64_
fixed hash64of an array: with the length a constant, the short classes inline without a call or a length branch. Same value ashash64(&key[..], seed).- hash128
- 128-bit lanehash of
bytesunderseed; its low half ishash64. - hash128_
fixed hash128of an array, seehash64_fixed.