jump-consistent-hash

Implementation of the Jump Consistent Hash algorithm


Keywords
jump, consistent, hash, jumphash, algorithm, consistent-hashing, python
License
MIT
Install
pip install jump-consistent-hash==3.5.0

Documentation

Jump Consistent Hash

Build Status

Python and C implementation of the jump consistent hash algorithm by John Lamping and Eric Veach[1]. Tested on Python 3.8+.

Install

To install Jump Consistent Hash, simply run this simple command in your terminal of choice:

$ pip install jump-consistent-hash

The C implementation is optional but is about 10x faster than the pure Python implementation in CPython.

Usage

If you want to use a str as a key instead of an int, you can pass it through a hash function to compute a real key. Here's a couple of examples using Python 3:

[1] http://arxiv.org/pdf/1406.2294v1.pdf