ketama-hash-ring 11.1.0

Zero-dependency consistent hashing suite implementing Jump Consistent Hash, weighted Ketama virtual-node rings, and Google Maglev O(1) lookup tables.
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented0 out of 0 items with examples
  • Size
  • Source code size: 24.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 249.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates-dev/ctares
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vshengbro

ketama-hash-ring

Zero-Dependency Jump Hash, Weighted Ketama Ring & Google Maglev Lookup Suite

crates.io docs.rs Rust 2024 License: MIT

Workspace Overview · API Docs · Agent Engineering Rules


Overview

Provides zero-dependency consistent hashing primitives: Lamping-Veach jump_ketama_hash_ring, weighted ConsistentHashRing with replica selection, and Google MaglevHash O(1) lookup tables.

This package is part of the ctares unified Rust 2024 workspace and follows the repository's strict module purity, formatting, and dependency-ordered release standards.

Installation & Quick Start

cargo add ketama-hash-ring
use ketama_hash_ring::*;

let bucket: u32 = jump_ketama_hash_ring(hash_bytes(b"tenant-42"), 16);
assert!(bucket < 16);

let mut ring: ConsistentHashRing<&str> = ConsistentHashRing::default();
ring.add_node("node-1", "10.0.0.1");
ring.add_node("node-2", "10.0.0.2");
assert!(ring.get(b"session-abc").is_some());

License

This project is licensed under the MIT License. See the LICENSE file for details.