Skip to main content

Crate hashkit

Crate hashkit 

Source
Expand description

Unified non-cryptographic hash functions for performance-sensitive crates.

The crate exposes three small, dependency-free building blocks:

  • fnv for stable FNV-1a hashing, including the flashsieve-compatible two-byte fast path.
  • splitmix for high-quality seed finalization and compact pair hashing.
  • wyhash for fast bulk hashing of arbitrary byte slices.
  • blake3_hash for stable, content-addressed streaming hashing using BLAKE3.

§Examples

use hashkit::{bloom_hash_pair, hash_to_index};

let (h1, h2) = bloom_hash_pair(b'a', b'b');
let slot = hash_to_index(h1 ^ h2, 1024);

assert!(slot < 1024);

Modules§

blake3_hash
BLAKE3 content hashing for deduplication and stability.
fnv
FNV-1a hashing helpers.
splitmix
SplitMix64 finalization helpers.
wyhash
WyHash bulk hashing.

Functions§

bloom_hash_pair
Returns the two hash functions used for double-hashed bloom filter probes.
hash_to_index
Reduces a hash into a bit index.