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
gxhash
feature, - wyhash - enabled by (default)
wyhash
feature, - xxh3 - enabled by
xxhash-rust
feature, - rapidhash - enabled by
rapidhash
feature, - Sip13 using unstable standard library feature
hashmap_internals
- enabled bysip13
feature, - Fowler–Noll–Vo - enabled by
fnv
feature, - standard
hash_map::DefaultHasher
viaSeedable
wrapper - always enabled, - and others via
Seedable
wrapper.
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 BuildSeededHasher
that useswyhash
crate.- Seedable
BuildSeededHasher
that uses standardBuildHasher
.
Traits§
- Build
Seeded Hasher - Family of hash functions that allows the creation of
Hasher
instances initialized with a given seed.
Functions§
- map16_
to_ 16 - Maps 16-bit
hash
to the range[0, n)
, wheren
is a 16-bit integer. - map32_
to_ 32 - Maps 32-bit
hash
to the range[0, n)
, wheren
is a 32-bit integer. - map64_
to_ 32 - Maps 64-bit
hash
to the range[0, n)
, wheren
is a 32-bit integer. - map64_
to_ 64 - Maps 64-bit
hash
to the range[0, n)
, wheren
is a 64-bit integer. - map_
usize - Maps
hash
to the range[0, n)
using eithermap64_to_64
ormap32_to_32
(depended on platform).
Type Aliases§
- Build
Default Seeded Hasher - The default
BuildSeededHasher
.