'Apply num_probes_k hash functions to key, yield each bit so that
we can perform a bit by bit check in __contains__ and in most cases
increase performance by not calculating all hashes.
:return: A trail of bits to check in the file.'

def generate_bits_for_key(self, key):

    key_str = self.to_bytes(key)
    m = hashlib.md5()
    for i in xrange(self.num_hashes):
        seed = self.hash_seeds[i]
        m.update(seed)
        m.update(key_str)
        hash_result = m.digest()
        long_numbers = struct.unpack('QQ', hash_result)
        bitno = (sum(long_numbers) % self.num_bits)
        (yield bitno)
