Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bloom ¶
type Bloom struct {
// contains filtered or unexported fields
}
Bloom represents a bloom filter. It holds the filter itself, the hashing functions that must be applied to values that are added to the filter and a mutex to handle concurrent accesses to the filter
func NewDefaultFilter ¶
func NewDefaultFilter() *Bloom
NewDefaultFilter returns a new Bloom object with a filter size of 2048 bytes and implementations of blake2b, sha3-keccak and fnv128a hashing functions
func NewFilter ¶
NewFilter returns a new Bloom object with the given size and hashing functions implementation. It returns an error if there are no hashing functions, or if the size of the filter is too small
func (*Bloom) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Bloom) MayContain ¶
MayContain checks if the bits that correspond to the hashes of the data are set. If all the bits are set, it returns true, otherwise it returns false