Documentation
¶
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 implements a thread-safe Bloom Filter for high-speed deduplication.
func NewBloomFilter ¶
func NewBloomFilter(m, k uint) *BloomFilter
NewBloomFilter creates a new Bloom Filter with m bits and k hash functions.
func (*BloomFilter) Test ¶
func (f *BloomFilter) Test(data []byte) bool
Test returns true if data might be in the filter.
type RotatingBloomFilter ¶
type RotatingBloomFilter struct {
// contains filtered or unexported fields
}
RotatingBloomFilter uses two Bloom Filters to provide a sliding window of deduplication.
func NewRotatingBloomFilter ¶
func NewRotatingBloomFilter(m, k, limit uint) *RotatingBloomFilter
NewRotatingBloomFilter creates a new RotatingBloomFilter that rotates after limit additions.
func (*RotatingBloomFilter) Add ¶
func (f *RotatingBloomFilter) Add(data []byte)
Add adds data to the current filter and rotates if limit is reached.
func (*RotatingBloomFilter) Reset ¶
func (f *RotatingBloomFilter) Reset()
Reset clears both filters.
func (*RotatingBloomFilter) Test ¶
func (f *RotatingBloomFilter) Test(data []byte) bool
Test checks both current and previous filters.
Click to show internal directories.
Click to hide internal directories.