Crate rustc_hash

Source
Expand description

A speedy, non-cryptographic hashing algorithm used by rustc.

Β§Example

use rustc_hash::FxHashMap;

let mut map: FxHashMap<u32, u32> = FxHashMap::default();
map.insert(22, 44);

ModulesΒ§

seeded_state πŸ”’

StructsΒ§

FxBuildHasher
An implementation of BuildHasher that produces FxHashers.
FxHasher
A speedy hash algorithm for use within rustc. The hashmap in liballoc by default uses SipHash which isn’t quite as speedy as we want. In the compiler we’re not really worried about DOS attempts, so we use a fast non-cryptographic hash.
FxSeededState
FxSeededState is an alternative state for HashMap types, allowing to use FxHasher with a set seed.

ConstantsΒ§

K πŸ”’
PREVENT_TRIVIAL_ZERO_COLLAPSE πŸ”’
SEED1 πŸ”’
SEED2 πŸ”’

FunctionsΒ§

hash_bytes πŸ”’
A wyhash-inspired non-collision-resistant hash for strings/slices designed by Orson Peters, with a focus on small strings and small codesize.
multiply_mix πŸ”’

Type AliasesΒ§

FxHashMap
Type alias for a hash map that uses the Fx hashing algorithm.
FxHashMapSeed
Type alias for a hashmap using the fx hash algorithm with FxSeededState.
FxHashSet
Type alias for a hash set that uses the Fx hashing algorithm.
FxHashSetSeed
Type alias for a hashmap using the fx hash algorithm with FxSeededState.