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 is a bloom filter.
func Basic ¶
func Basic(size int) *BloomFilter
Basic returns a basic bloom filter with four has functions given a size. The size is rounded to the nearest 8.
func Custom ¶
func Custom(size int, hashfns ...hash.Hash64) *BloomFilter
Custom returns a bloom filter given a size and hash functions. The size is rounded to the nearest 8.
func (*BloomFilter) Insert ¶
func (bl *BloomFilter) Insert(data []byte)
Insert puts data into the bloom filter.
func (*BloomFilter) MarshalBinary ¶
func (bl *BloomFilter) MarshalBinary() (data []byte, err error)
MarshalBinary returns the bloom filter's bitset in binary. It never returns an error.
func (*BloomFilter) Search ¶
func (bl *BloomFilter) Search(data []byte) (pos bool)
Search queries the bloom filter with data.
func (*BloomFilter) String ¶
func (bl *BloomFilter) String() string
String returns a string representation of the bloom filter's bitset as a series of ones and zeros.
func (*BloomFilter) UnmarshalBinary ¶
func (bl *BloomFilter) UnmarshalBinary(data []byte) (err error)
UnmarshalBinary reads from data in binary and writes to bloom filter's bitset. It never returns an error.
Click to show internal directories.
Click to hide internal directories.