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
orHashSet
.Deref
andDerefMut
provide access to the wrapped type. To create, use thenew
method 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.
Deref
andDerefMut
provide access to the wrapped type. - UseDefault
Hasher - Implementation of
BuildHasherFromFriend
which uses the default hasher, always - UseProvided
Hasher - Implementation of
BuildHasherFromFriend
which requires that the peer provides the hasher, i.e. thatProvidesHasher
is 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
HashMap
andHashSet
. It allows the wrapperSumHashes
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.