bloomfilter

package
v0.0.0-...-3971520 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 6 Imported by: 0

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
}

func New

func New(m uint, k uint) *BloomFilter

New creates a new bloom filter with m bits and k hashing functions.

func NewEstimated

func NewEstimated(n uint, fp float64) *BloomFilter

NewEstimated creates a new Bloom filter for about n items with fp false positive rate

func (*BloomFilter) Add

func (f *BloomFilter) Add(data []byte)

Add data to the Bloom Filter

func (*BloomFilter) Test

func (f *BloomFilter) Test(data []byte) bool

Test checks for the presence of data in the Bloom filter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL