jmphash

Crates.iojmphash
lib.rsjmphash
version0.1.0
sourcesrc
created_at2016-11-27 21:22:06.206504
updated_at2016-11-27 21:22:06.206504
descriptionAn implementation of the jump consistent hash algorithim
homepagehttps://github.com/jeromefroe/jmphash-rs
repositoryhttps://github.com/jeromefroe/jmphash-rs.git
max_upload_size
id7384
size6,187
Jerome Froelich (jeromefroe)

documentation

https://docs.rs/jmphash/

README

Jump Consistent Hash

Build Status Coverage Status License

An implementation of the jump consistent hash algorithim as described in [A Fast, Minimal Memory, Consistent Hash Algorithim] (https://arxiv.org/pdf/1406.2294v1.pdf).

Example

extern crate jmphash;

use jmphash::jump_hash;

fn really_complicated_hash_function() -> u64 {
  42
}

fn main() {
    let num_buckets = 100;

    // first use a hash function of your choice to create a u64 key
    let key = really_complicated_hash_function();

    // then one can use `jump_hash` to map the key to a bucket
    let bucket = jump_hash(key, num_buckets);
}
Commit count: 11

cargo fmt