merkle-db.bloom

Bloom filters provide a probablistic way to test for membership in a set using a fixed amount of space. This is useful for reducing work when the test definitively rules out the existence of a record.

create

(create expected-size)(create expected-size error-rate)

Constructs a new bloom filter with the given expected population size and desired error (false positive) rate.

filter->form

(filter->form x)

Build a serializable form for the bloom filter.

filter?

(filter? x)

Predicate which tests whether the value is a BloomFilter.

form->filter

(form->filter form)

Build a bloom filter from a serialized form.

merge

(merge a b)

Merge the bloom filters together. Only works if bits and k match.

mergeable?

(mergeable? a b)

Returns true if the two bloom filters can be merged together.