BloomFilter

package
v0.0.0-...-de9bdf8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 4 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[T Hashable] struct {
	// contains filtered or unexported fields
}

func NewBloomFilter

func NewBloomFilter[T Hashable](size int) *BloomFilter[T]

Create a new Bloom Filter

func (*BloomFilter[T]) Add

func (b *BloomFilter[T]) Add(value T)

Add elements to the filter

func (*BloomFilter[T]) Check

func (b *BloomFilter[T]) Check(value T) bool

Check if an element is in the filter

func (*BloomFilter[T]) Reset

func (b *BloomFilter[T]) Reset()

Clear the filter and reset the count

type Hashable

type Hashable interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string
}

Jump to

Keyboard shortcuts

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