Module hashing

Module hashing 

Source
Expand description

This module provides a deterministic hasher and HashMap and HashSet variants that use it. The hashing data structures in the standard library are not deterministic:

By default, HashMap uses a hashing algorithm selected to provide resistance against HashDoS attacks. The algorithm is randomly seeded, and a reasonable best-effort is made to generate this seed from a high quality, secure source of randomness provided by the host without blocking the program.

The standard library HashMap has a new method, but HashMap<K, V, S> does not have a new method by default. Use HashMap::default() instead to create a new hashmap with the default hasher. If you really need to keep the API the same across implementations, we provide the HashMapExt trait extension. Similarly, for HashSet and HashSetExt.The traits need only be in scope.

Traits§

HashMapExt
Provides API parity with std::collections::HashMap.
HashSetExt
Provides API parity with std::collections::HashSet.

Functions§

hash_serialized_128
hash_str
A convenience method to compute the hash of a &str.
one_shot_128

Type Aliases§

HashMap
Type alias for a hash map that uses the Fx hashing algorithm.
HashSet
Type alias for a hash set that uses the Fx hashing algorithm.