Consistent hashing algorithm with python