ketama-hash-ring 11.2.0

Zero-dependency consistent hashing suite implementing Jump Consistent Hash, weighted Ketama virtual-node rings, and Google Maglev O(1) lookup tables.
Documentation
/// One physical node entry stored in a [`ConsistentHashRing`].
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct RingNode<N> {
    /// Unique stable identifier used to hash virtual replicas.
    pub(crate) id: String,
    /// Relative weight (`>= 1`) scaling virtual node count.
    pub(crate) weight: usize,
    /// User-supplied node value.
    pub(crate) value: N,
}

/// Weighted Ketama virtual-node consistent hash ring with SoA cache-friendly binary search.
#[derive(Clone, Debug)]
pub struct ConsistentHashRing<N> {
    /// Virtual nodes per unit of weight.
    pub(crate) virtual_nodes: usize,
    /// Physical nodes indexed by compact `u32`.
    pub(crate) nodes: Vec<RingNode<N>>,
    /// Sorted contiguous virtual-node hash points for L1-dense binary search.
    pub(crate) ring_hashes: Vec<u64>,
    /// Parallel compact `u32` physical node index for each virtual point.
    pub(crate) ring_nodes: Vec<u32>,
}