envzn
0.8 · beta · not released

Library / Hashing / Hashing / FastIntHasher

CLASSIMPLEMENTS Hasher<K>

FastIntHasher

FastIntHasher implements Hasher OF K (Hasher.ev) with an IDENTITY hash: the key widened into a uint64, no mixing. For integer keys this maps the benchmark's sequential keys (0..N-1) to sequential slots under the pow2 & mask index, so every probe is a cache-friendly prefetch — the ~1.5 ns/lookup path that C and C++ take (their std::hash<int> is also identity). char widens its code point. The WordKey qualifier admits no float, so nothing is reinterpreted here; a 128-bit key keeps its low half, which collides only above bit 63 and is separated on lookup by Equatable.

Constructors 1

INIT()

Methods 2

METHOD hash(REFERENCE K key) RETURNS uint64
reads
METHOD clone() RETURNS FastIntHasher[K]
reads

Stateless — a fresh instance behaves identically. Cloneable so a dictionary that stores the hasher CONCRETELY (H hasher, monomorphised) can deep-copy itself (clone()) by cloning its hasher.