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§
- Hash
MapExt - Provides API parity with
std::collections::HashMap. - Hash
SetExt - 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