bloomfilter: github.com/httpimp/bloomfilter Index | Files

package bloomfilter

import "github.com/httpimp/bloomfilter"

Index

Package Files

bloomfilter.go

func EstimateParameters Uses

func EstimateParameters(n int, p float64) (m int, k int)

EstimateParameters estimates requirements for m and k. https://github.com/willf/bloom

type BloomFilter Uses

type BloomFilter struct {
    // contains filtered or unexported fields
}

func New Uses

func New(m, k int) *BloomFilter

New creates a new bloom filter. m should specify the number of bits. m is rounded up to the nearest multiple of 32. k specifies the number of hashing functions.

func NewFromBytes Uses

func NewFromBytes(bb []byte, k int) *BloomFilter

NewFromBytes creates a new bloom filter from a byte slice. b is a byte slice exported from another bloomfilter. k specifies the number of hashing functions.

func (*BloomFilter) Add Uses

func (bf *BloomFilter) Add(v []byte)

Add adds a byte array to the bloom filter

func (*BloomFilter) AddInt Uses

func (bf *BloomFilter) AddInt(v int)

AddInt adds an int to the bloom filter

func (*BloomFilter) Test Uses

func (bf *BloomFilter) Test(v []byte) bool

Test evaluates a byte array to determine whether it is (probably) in the bloom filter

func (*BloomFilter) TestInt Uses

func (bf *BloomFilter) TestInt(v int) bool

TestInt evaluates an int to determine whether it is (probably) in the bloom filter

func (*BloomFilter) ToBytes Uses

func (bf *BloomFilter) ToBytes() []byte

ToBytes returns the bloom filter as a byte slice

Package bloomfilter imports 3 packages (graph). Updated 2018-10-11. Refresh now. Tools for package owners.