simple consistent hashing implementation