Crate hash_that_set

Source
Expand description

This crate is dedicated to the sole purpose of hashing collections of elements in an iteration order-independent fashion. For example, it can be used to hash a HashMap or HashSet.

Documentation referring to a “collection” means any type C where &C: IntoIterator

Structs§

SumHashes
Adds hashing to any collection according to the hash of each element, but without respecting iteration order. Instantly usable with HashMap or HashSet. Deref and DerefMut provide access to the wrapped type. To create, use the new method or From.
SumHashesAnyCollection
Adds hashing to any collection according to the hash of each element, but without respecting iteration order. Always usable with any collection, via the default hasher. Deref and DerefMut provide access to the wrapped type.
UseDefaultHasher
Implementation of BuildHasherFromFriend which uses the default hasher, always
UseProvidedHasher
Implementation of BuildHasherFromFriend which requires that the peer provides the hasher, i.e. that ProvidesHasher is implemented for the peer object

Traits§

BuildHasherFromFriend
Like the standard library’s BuildHasher, but takes the hashing implementation from a peer
ProvidesHasher
Trait for types which provide a hashing implementation. This is automatically implemented for HashMap and HashSet. It allows the wrapper SumHashes to use the same hashing implementation for elements as is used for the whole hash result.

Functions§

hash_by_summing_hashes
Implements hashing by summing the hashes of each element. A new DefaultHasher is created for each element, its result added to the total calculation.
hash_by_summing_hashes_with
The main function implementing hashing by summing the hashes of each element, with a means of specifying which kind of hasher is created per element via the BH parameter.