bloomfilter

package
v2.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL