Implements consistent hashing in Erlang