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 FromSerialized ¶
FromSerialized deserializes a Bloom filter from a byte slice using MessagePack.
func NewFilterFromBits ¶
NewFilterFromBits initializes a Bloom filter from an existing bit slice and specified number of hash functions. This can be useful when deserializing or reconstructing a Bloom filter from stored data.
func NewFilterFromEntriesAndFP ¶
NewFilterFromEntriesAndFP initializes a Bloom filter with a specified number of entries and desired false positive rate. It calculates the necessary size (in bytes) and the optimal number of hash functions (K).
func NewFilterFromEntriesAndSize ¶
NewFilterFromEntriesAndSize initializes a Bloom filter with a specified number of entries and storage size in bytes. It calculates the optimal number of hash functions (K) based on the provided parameters.
func (*Filter) Exists ¶
Exists checks whether a key is possibly in the Bloom filter. Returns true if the key might be in the set, or false if it is definitely not present.