Documentation ¶
Overview ¶
Package bloomfilter implements a simple bloom filter using hashing functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
BloomFilter is a struct representing a bloom filter.
func NewBloomFilter ¶
func NewBloomFilter(size int, funcs []HashFunc) *BloomFilter
NewBloomFilter returns a new bloom filter instance.
The size parameter specifies the size of the in-memory bloom filter array. The funcs parameter is a slice of HashFuncs that will be used to hash inputs to the bloom filter.
func (*BloomFilter) Add ¶
func (b *BloomFilter) Add(key string)
Add adds a new input string to the bloom filter.
func (*BloomFilter) Check ¶
func (b *BloomFilter) Check(key string) bool
Check checks whether an input string is probably in the bloom filter.
func (*BloomFilter) Remove ¶
func (b *BloomFilter) Remove(key string)
Remove removes an input string from the bloom filter
Click to show internal directories.
Click to hide internal directories.