consistent-hashing from https://github.com/tomwhite/articles/tree/master/consistent-hashing