bloom

package
v1.1.5-0...-12a9ee2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooLargeOffset = errors.New("too large offset")

Functions

This section is empty.

Types

type BitSetProvider

type BitSetProvider interface {
	// contains filtered or unexported methods
}

type BloomFilter

type BloomFilter struct {
	// contains filtered or unexported fields
}

func New

func New(store *redis.Redis, key string, bits uint) *BloomFilter

New create a BloomFilter, store is the backed redis, key is the key for the bloom filter, bits is how many bits will be used, maps is how many hashes for each addition. best practices: elements - means how many actual elements when maps = 14, formula: 0.7*(bits/maps), bits = 20*elements, the error rate is 0.000067 < 1e-4 for detailed error rate table, see http://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html

func (*BloomFilter) Add

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

func (*BloomFilter) Exists

func (f *BloomFilter) Exists(data []byte) (bool, error)

Jump to

Keyboard shortcuts

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