Registry / utility / nohash-hasher

nohash-hasher

JSON →
library0.2.0rscratesunverified

An implementation of `std::hash::Hasher` which does not hash at all, useful for integer keys.

# Cargo.toml [dependencies] nohash-hasher = "0.2.0"
INSTALL
IMPORT
SIG · NOHASH-HASHER
N
nohash-hasher
utilityrustv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NoHashHasher
use nohash_hasher::NoHashHasher;

Creates a HashSet using NoHashHasher for u64 keys.

use nohash_hasher::NoHashHasher; use std::hash::BuildHasherDefault; fn main() { let mut set: std::collections::HashSet<u64, BuildHasherDefault<NoHashHasher<u64>>> = Default::default(); set.insert(42); println!("Set size: {}", set.len()); }
Debug
Known issues
gotchaOnly safe for keys that are already well-distributed (e.g., integers from a hash function)
fix
Use only with keys that have no collisions; otherwise, performance degrades.
affects: >=0.2.0
Upgrade
Version history
0.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
nohash-hasher — cargo add nohash-hasher · libregistry