using user-provided hash functions