JenkHash
A collection of Bob Jenkins hash functions for Rust with a unified API. The crate targets no_std, follows the digest traits, and ships reference implementations of several classic non-cryptographic hashes.
Available Hash Functions
OneAtATime— simple, fast 32-bit hash for hash tablesLookup2— original Jenkins hash (32-bit)Lookup3— improved Jenkins hash with stronger avalanche (32-bit)Spooky— high-performance hash optimized for 64-bit CPUs (variable output sizes)
Installation
Add the crate to your Cargo.toml:
[]
= "0.1"
= "0.10"
Usage
use OneAtATime;
use ;
let mut hasher = new;
hasher.update;
hasher.update;
let result = hasher.finalize_fixed;
assert_eq!;
Notes
- Use these hashes for non-cryptographic purposes (e.g., hash tables, sharding, deduplication).
- Keep input sizes reasonable; these algorithms are not designed as secure cryptographic hashes.
Development
- Tests:
cargo test - Lint (Clippy):
cargo clippy --all-targets --all-features