sample implementation for consistent hashing