simple

package
v0.0.0-...-3e779d4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: BSD-3-Clause Imports: 3 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
}

Filter is a simple Bloom filter with customizable bucket size. It uses the FNV-1a hash with the a*ib % m trick to create i hashes from a single FNV-1a computation.

func New

func New(buckets, hashes uint64) *Filter

New creates a new Filter with the given number of buckets and hashes.

func (*Filter) Add

func (f *Filter) Add(b []byte)

Add adds value b to the filter.

func (*Filter) Contains

func (f *Filter) Contains(b []byte) bool

Contains checks to see if the filter contains value b.

Jump to

Keyboard shortcuts

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