Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
BloomFilter is an implementation of bloom filter
func New ¶
func New(m, k uint64, opts ...Option) *BloomFilter
New creates a new BloomFilter with m bits and k hash functions
func NewFromData ¶
func NewFromData(data []byte, opts ...Option) *BloomFilter
NewFromData creates a new BloomFilter from data generated by function 'Data()'
func NewWithEstimates ¶
func NewWithEstimates(n uint64, fp float64, opts ...Option) *BloomFilter
NewWithEstimates creates a new BloomFilter with n and fp. n is the capacity of the BloomFilter fp is the tolerated error rate of the BloomFilter
func (*BloomFilter) Contains ¶
func (bf *BloomFilter) Contains(val string) bool
Contains returns true if val is (high probability) in the BloomFilter, otherwise returns false.
func (*BloomFilter) Data ¶
func (bf *BloomFilter) Data() []byte
Data returns the data of the BloomFilter, it can bee used to creates a new BloomFilter by using function 'NewFromData' .
Click to show internal directories.
Click to hide internal directories.