Merge branch 'master' into bloom
[adu.git] / bloom.h
1 struct bloom {
2 unsigned order;
3 unsigned num_hash_functions;
4 uint64_t num_entries;
5 uint64_t num_set_bits;
6 uint8_t *filter;
7 };
8
9 int bloom_init(unsigned bloom_filter_order, unsigned num_hash_functions,
10 struct bloom **result);
11 void bloom_free(struct bloom *b);
12 int bloom_test_and_insert(const uint8_t *data, size_t len, struct bloom *b);