Consistent hash

writen in c++