Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func NewFilter ¶
NewFilter creates a new filter if the number of bits is not a multiple of 64 it's rounded up to the next multiple of 64 the number of bits and hashes must be 1 or higher, otherwise an error is returned
func NewIntersection ¶
func (*Filter) AddBytes ¶
AddBytes is equivalent to AddString but is better when the data is already a []byte
func (*Filter) Intersects ¶
Intersects tests if the filter intersects with another given filter "b" 2 filters intersecting means that a value that was added to one filter was probably also added to the other
this function is useful if you have a set of values that you want to test against a many filters it is more efficient to make a new filter, add this set and test for intersection than to do multiple lookups when the filters are used this way, it's better to use just one hash
if the 2 filters being tested have different size or number of hashes, this method gives a false positive
func (*Filter) LookupBytes ¶
LookupBytes is equivalent to LookupString but is better when the data is already a []byte
func (*Filter) LookupString ¶
LookupString check if the given string was added to the filter it returns true when the string was probably added if may give a false positive, but never a false negative