2 * Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file bloom.h Struct bloom and bloom filter functions. */
9 /** Describes one instance of a bloom filter. */
11 /** The bloom filter is of size 2^order bits. */
13 /** Set that many bits in the filter per entry. */
14 unsigned num_hash_functions;
15 /** How many entries have been inserted so far. */
17 /** Number of bits currently set. */
18 uint64_t num_set_bits;
23 struct bloom *bloom_new(unsigned order, unsigned num_hash_functions);
24 void bloom_free(struct bloom *b);
25 int bloom_insert(const uint8_t *data, size_t len, struct bloom *b);