Documentation ¶
Index ¶
- type BloomFilter
- func (bf *BloomFilter[T]) Add(item T)
- func (bf *BloomFilter[T]) BitSize() uint
- func (bf *BloomFilter[T]) Clear()
- func (bf *BloomFilter[T]) Contains(item T) bool
- func (bf *BloomFilter[T]) EstimatedFalsePositiveRate() float64
- func (bf *BloomFilter[T]) IsEmpty() bool
- func (bf *BloomFilter[T]) Len() int
- func (bf *BloomFilter[T]) NumberOfHashes() uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
type BloomFilter[T any] struct { // contains filtered or unexported fields }
func NewBloomFilter ¶
func NewBloomFilter[T any](expectedItems uint, falsePositiveProb float64) *BloomFilter[T]
func (*BloomFilter[T]) Add ¶
func (bf *BloomFilter[T]) Add(item T)
Add inserts an item into the Bloom Filter.
func (*BloomFilter[T]) BitSize ¶
func (bf *BloomFilter[T]) BitSize() uint
BitSize returns the size of the bit array.
func (*BloomFilter[T]) Clear ¶
func (bf *BloomFilter[T]) Clear()
Clear removes all items from the Bloom Filter.
func (*BloomFilter[T]) Contains ¶
func (bf *BloomFilter[T]) Contains(item T) bool
Contains tests whether an item might be in the set.
func (*BloomFilter[T]) EstimatedFalsePositiveRate ¶
func (bf *BloomFilter[T]) EstimatedFalsePositiveRate() float64
EstimatedFalsePositiveRate returns the estimated false positive rate.
func (*BloomFilter[T]) IsEmpty ¶
func (bf *BloomFilter[T]) IsEmpty() bool
IsEmpty returns true if no items have been added to the Bloom Filter.
func (*BloomFilter[T]) Len ¶
func (bf *BloomFilter[T]) Len() int
Len returns the number of items added to the Bloom Filter.
func (*BloomFilter[T]) NumberOfHashes ¶
func (bf *BloomFilter[T]) NumberOfHashes() uint
NumberOfHashes returns the number of hash functions.
Click to show internal directories.
Click to hide internal directories.