Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buckets ¶
type Buckets struct {
// contains filtered or unexported fields
}
Buckets is a fast, space-efficient array of buckets where each bucket can store up to a configured maximum value.
func NewBuckets ¶
NewBuckets creates a new Buckets with the provided number of buckets where each bucket is the specified number of bits.
func (*Buckets) MaxBucketValue ¶
MaxBucketValue returns the maximum value that can be stored in a bucket.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter implements a classic thread-safe Bloom filter. A Bloom filter has a non-zero probability of false positives and a zero probability of false negatives.
func New ¶
New creates a new Bloom filter optimized to store n items with a specified target false-positive rate.
func (*Filter) Add ¶
Add will add the data to the Bloom filter. It returns the filter to allow for chaining.
func (*Filter) TestAndAdd ¶
TestAndAdd is equivalent to calling Test followed by Add. It returns true if the data is a member, false if not.