user can choose hashing function