Documentation
¶
Overview ¶
Package bloom provides a space-efficient probabilistic set-membership filter. MayContain returns false only when an element is definitely absent; it may return true for elements never added (false positives). No false negatives are possible.
The filter uses the enhanced double-hashing scheme from Kirsch & Mitzenmacher (2006): two base FNV hashes produce k independent bit positions per element without needing k separate hash functions.
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 Bloom filter backed by a compact bit array.
func New ¶
New returns a Filter sized for n expected elements at false-positive probability p. p must be in (0,1); n must be > 0.
func (*Filter) MayContain ¶
MayContain reports whether data might be in the set. Returns false only when data is definitely absent.