bloom

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 3 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
}

布隆过滤器结构体

func New

func New(store Store, expectedElements uint, falsePositiveRate float64) *BloomFilter

初始化布隆过滤器

func (*BloomFilter) Add

func (bf *BloomFilter) Add(ctx context.Context, data string) error

添加元素到布隆过滤器

func (*BloomFilter) Test

func (bf *BloomFilter) Test(ctx context.Context, data string) (bool, error)

检查元素是否在布隆过滤器中

type Store

type Store interface {
	SetBit(ctx context.Context, offset int64, value int) (int64, error)
	BitField(ctx context.Context, offsets []uint) ([]int64, error)
}

Jump to

Keyboard shortcuts

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