filter

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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 Build

func Build(kvs []types.Entry) *Filter

func New

func New(n int, p float64) *Filter

New creates a new BloomFilter with the given size and number of hash functions. n: expected nums of elements p: expected rate of false errors

func (*Filter) Add

func (f *Filter) Add(key string)

Add adds an element to the BloomFilter.

func (*Filter) Contains

func (f *Filter) Contains(key string) bool

Contains checks if an element is in the BloomFilter.

Jump to

Keyboard shortcuts

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