Documentation
¶
Overview ¶
Package bloom implements a Bloom Filter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a delta-compressable bloom filter. following the logic from http://www.eecs.harvard.edu/~michaelm/NEWWORK/postscripts/cbf2.pdf
func New ¶
New constructs a new Filter with a filter set size of 2^mLn2 which allows an entry factor up to load before dropping layers at new deltas.
func (*Filter) Entries ¶
Entries returns the number of entries that have been inserted into the Filter.
func (*Filter) MaxEntries ¶
MaxEntries returns the maximum capacity of the Filter.
func (*Filter) Test ¶
Test tests the Filter for a given value's membership and returns true iff it is present (or a false positive).
func (*Filter) TestAndSet ¶
TestAndSet tests the Filter for a given value's membership, adds the value to the filter, and returns true iff it was present at the time of the call.