bloomfilter

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 1 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 interface {
	Set([]byte)
	Check([]byte) bool
}

func NewBloomFilter

func NewBloomFilter(size int64, falseRate float64) BloomFilter

type MemoryBloomFilter

type MemoryBloomFilter struct {
	MLength   int64   // 过滤器长度
	MArr      []int64 // 过滤器数组
	NCount    int64   // 插入元素个数
	FalseRate float64 // 误报率
	KHash     int     // hash函数个数
}

func (*MemoryBloomFilter) Check

func (bf *MemoryBloomFilter) Check(data []byte) bool

func (*MemoryBloomFilter) Set

func (bf *MemoryBloomFilter) Set(data []byte)

Jump to

Keyboard shortcuts

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