varErrUsage=errors.New("usage: New(float64(number_of_entries), float64(number_of_hashlocations)) i.e. New(float64(1000), float64(3)) or New(float64(number_of_entries), float64(ratio_of_false_positives)) i.e. New(float64(1000), float64(0.03))")
varErrInvalidParms=errors.New("One of parameters was outside of allowed range")
log.Fatal("usage: New(float64(number_of_entries), float64(number_of_hashlocations)) i.e. New(float64(1000), float64(3)) or New(float64(number_of_entries), float64(ratio_of_false_positives)) i.e. New(float64(1000), float64(0.03))")
returnnil,ErrUsage
}
size,exponent:=getSize(uint64(entries))
bloomfilter=Bloom{
bloomfilter=&Bloom{
sizeExp:exponent,
size:size-1,
setLocs:locs,
shift:64-exponent,
bitset:make([]uint64,size>>6),
}
returnbloomfilter
returnbloomfilter,nil
}
// NewWithBoolset
// takes a []byte slice and number of locs per entry
// returns the bloomfilter with a bitset populated according to the input []byte