Expand description
seedable_hash is the Rust library (by Piotr Beling) for calculating seedable hashes and fast reduction of their ranges.
seedable_hash conditionally supports hash functions from many crates:
- GxHash - enabled by
gxhashfeature, - wyhash - enabled by (default)
wyhashfeature, - xxh3 - enabled by
xxhash-rustfeature, - rapidhash - enabled by
rapidhashfeature, - Sip13 using unstable standard library feature
hashmap_internals- enabled bysip13feature, - Fowler–Noll–Vo - enabled by
fnvfeature, - standard
hash_map::DefaultHasherviaSeedablewrapper - always enabled, - and others via
Seedablewrapper.
BuildDefaultSeededHasher is an alias to the fastest of the enabled methods, selected according to the order of the above list.
We recommend GxHash (gxhash feature) on the platforms it supports.
For hashing integers, we recommend Fx Hash wrapped by Seedable.
Structs§
- Build
WyHash BuildSeededHasherthat useswyhashcrate.- Seedable
BuildSeededHasherthat uses standardBuildHasher.
Traits§
- Build
Seeded Hasher - Family of hash functions that allows the creation of
Hasherinstances initialized with a given seed.
Functions§
- map16_
to_ 16 - Maps 16-bit
hashto the range[0, n), wherenis a 16-bit integer. - map32_
to_ 32 - Maps 32-bit
hashto the range[0, n), wherenis a 32-bit integer. - map64_
to_ 32 - Maps 64-bit
hashto the range[0, n), wherenis a 32-bit integer. - map64_
to_ 64 - Maps 64-bit
hashto the range[0, n), wherenis a 64-bit integer. - map_
usize - Maps
hashto the range[0, n)using eithermap64_to_64ormap32_to_32(depended on platform).
Type Aliases§
- Build
Default Seeded Hasher - The default
BuildSeededHasher.