bloom

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitMapper

type BitMapper interface {
	// GetBit 返回存储在offset位置的值
	GetBit(key string, offset int64) int64
	// SetBit 设置存储在offset位置的值为value,并返回offset处的旧值
	SetBit(key string, offset int64, value int) int64
}

type Filter

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

func NewFilter

func NewFilter(key string, scale uint64, tolerance float64) *Filter

func (*Filter) BSet

func (filter *Filter) BSet(bitMapper BitMapper, target string) bool

BSet 设置target对应的位为1 设置成功返回true, 否则返回false

Jump to

Keyboard shortcuts

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