def generate_hashfunctions(nbr_bits, nbr_slices):
def _make_hashfuncs(key):<EOL><INDENT>if isinstance(key, text_type):<EOL><INDENT>key = key.encode('<STR_LIT:utf-8>')<EOL><DEDENT>else:<EOL><INDENT>key = str(key)<EOL><DEDENT>rval = []<EOL>current_hash = <NUM_LIT:0><EOL>for i in range(nbr_slices):<EOL><INDENT>seed = current_hash<EOL>current_hash = hash64(key, seed)<EOL>rval.append(current_hash % nbr_bits)<EOL><DEDENT>return rval<EOL><DEDENT>return _make_hashfuncs<EOL>
Generate a set of hash functions.

    The core method is a 64-bit murmur3 hash which has a good distribution.
    Multiple hashes can be generate using the previous hash value as a seed.