Consistent hashing in C