bloomfilter

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HASH_FUNCS = 8

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilter

type BloomFilter struct {
	NBits  uint32
	NProb  uint32
	Hashes []UHash
	BitSet *bitset.BitSet
}

func NewFilter

func NewFilter(M, N uint32) *BloomFilter

func (*BloomFilter) Set

func (filter *BloomFilter) Set(str string)

func (*BloomFilter) Test

func (filter *BloomFilter) Test(str string) bool

type UHash

type UHash struct {
	A   int64
	B   int64
	P   int64
	MAX int64
}

func UHashInit

func UHashInit(numbins uint32) UHash

---------------------------------------------------------- init a hash function

func (*UHash) Hash

func (h *UHash) Hash(X uint32) uint32

Jump to

Keyboard shortcuts

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