bloom

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: BSD-3-Clause Imports: 4 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
}

BloomFilter is a basic bloom filter implementation

func NewBloomFilter

func NewBloomFilter(n uint) *BloomFilter

NewBloomFilter returns a new filter with m number of bits available and hints to use k hash functions

func (*BloomFilter) Count added in v1.6.0

func (f *BloomFilter) Count() int

func (*BloomFilter) Has

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

Has returns true if the data is in the BloomFilter, false otherwise. If true, the result might be a false positive. If false, the data is definitely not in the set.

func (*BloomFilter) MayHave added in v1.4.0

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

func (*BloomFilter) Set

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

func (*BloomFilter) Size added in v1.7.0

func (f *BloomFilter) Size() int

func (*BloomFilter) Unset added in v1.6.0

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

Jump to

Keyboard shortcuts

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