Jump Consistent Hash NIF library for Erlang/Elixir.
This NIF implements the Jump Consistent Hash algorithm, created by John Lamping and Eric Veach developed at Google, Inc. This is the original paper: "A Fast, Minimal Memory, Consistent Hash Algorithm".
In your rebar.config
:
{deps, [
{jchash, "0.1.3"}
]}.
Usage example:
> jchash:compute(1, 2).
0
> jchash:compute(erlang:phash2(os:timestamp()), 100).
22
In your mix.exs
:
def deps do
[{:jchash, "~> 0.1"}]
end
Usage example:
> :jchash.compute(1, 2)
0
> System.system_time() |> :erlang.phash2() |> :jchash.compute(100)
22
$ rebar3 eunit
Copyright (c) 2016 Carlos Andres Bolaños R.A.
jchash source code is licensed under the MIT License.