137typedef uint32_t (*
hashfp_t)(
const uint8_t *,
size_t len);
uint32_t(* hashfp_t)(const uint8_t *, size_t len)
hash function to use in thee filter
void bloom_init(bloom_t *bloom, size_t size, uint8_t *bitfield, hashfp_t *hashes, int hashes_numof)
Initialize a Bloom Filter.
void bloom_del(bloom_t *bloom)
Delete a Bloom filter.
bool bloom_check(bloom_t *bloom, const uint8_t *buf, size_t len)
Determine if a string is in the Bloom filter.
void bloom_add(bloom_t *bloom, const uint8_t *buf, size_t len)
Add a string to a Bloom filter.
bloom_t bloom filter object
size_t m
number of bits in the bloom array
size_t k
number of hash functions
hashfp_t * hash
the hash functions
uint8_t * a
the bloom array