Skip to main content

Crate consistent_choose_k

Crate consistent_choose_k 

Source

Structs§

ConsistentChooseKHasher
Implementation of a consistent choose k hashing algorithm. It returns k distinct consistent hashes in the range 0..n. The hashes are consistent when n changes and when k changes! I.e. one hash changes with probability k/(n+1) when n increases by one, resp. one hash gets added when k is increased. Additionally, the returned k tuple is guaranteed to be uniformly chosen from all possible n-choose-k tuples.
ConsistentHashIterator
Same as ConsistentHashRevIterator, but iterates from smallest to largest for the range n...
ConsistentHashRevIterator
An iterator which enumerates all the consistent hashes for a given key from largest to smallest in the range 0..n.
ConsistentHasher
Wrapper around ConsistentHashIterator and ConsistentHashRevIterator to compute the next or previous consistent hash for a given key for a given number of nodes n.
ConsistentNodeMap
A consistent node map that supports dynamic addition and deletion of nodes.
ConsistentPermutation
n-consistent permutation iterator over 0..n driven by one bijection per level (see module docs).
ConsistentReservoir
Reservoir of size k whose contents track the consistent top-k by ConsistentPermutation rank, with explicit support for growing the universe one Feistel layer at a time.

Traits§

HashSeqBuilder
A trait for building a special bit mask and sequences of hashes for different bit positions. Note: the hasher must have been seeded with the key during construction.
HashSequence
A trait which behaves like a pseudo-random number generator. It is used to generate consistent hashes within one bucket. Note: the hasher must have been seeded with the key during construction.
ManySeqBuilder
A trait for building multiple independent hash builders Note: the hasher must have been seeded with the key during construction.