consistent hash implementation