Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
type BloomFilter[T encoding.BinaryMarshaler] interface { Add(value T) Contains(value T) bool }
type BloomFilterHash ¶
type BloomFilterHash[T encoding.BinaryMarshaler] struct { // contains filtered or unexported fields }
func NewBloomFilter ¶
func NewBloomFilter[T encoding.BinaryMarshaler](size int, numHash int) *BloomFilterHash[T]
NewBloomFilter creates a new BloomFilter with the specified size and number of hash functions
func (*BloomFilterHash[T]) Add ¶
func (bf *BloomFilterHash[T]) Add(element T)
Add inserts a new element into the Bloom filter
func (*BloomFilterHash[T]) Contains ¶
func (bf *BloomFilterHash[T]) Contains(element T) bool
Contains checks if the Bloom filter possibly contains the given element
Click to show internal directories.
Click to hide internal directories.