Provide a consistent hash function.