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
HashMaporHashSet.DerefandDerefMutprovide access to the wrapped type. To create, use thenewmethod orFrom. - SumHashes
AnyCollection - 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.
DerefandDerefMutprovide access to the wrapped type. - UseDefault
Hasher - Implementation of
BuildHasherFromFriendwhich uses the default hasher, always - UseProvided
Hasher - Implementation of
BuildHasherFromFriendwhich requires that the peer provides the hasher, i.e. thatProvidesHasheris implemented for the peer object
Traits§
- Build
Hasher From Friend - Like the standard library’s
BuildHasher, but takes the hashing implementation from a peer - Provides
Hasher - Trait for types which provide a hashing implementation. This is automatically implemented
for
HashMapandHashSet. It allows the wrapperSumHashesto 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
DefaultHasheris 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
BHparameter.