Implements consistent hashing in Python (using md5 as hashing function)