bloom

package
v0.0.0-...-01c881c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	M                   = 256  // 2048 bits / 8 bits per byte = 256 bytes
	K                   = 30   // wnfs bloom filters use 30 hashes
	SaturationThreshold = 1019 // ones-count obfuscation minimum
)

this bloom filter is hardcoded with an m of 2048 bits (256 bytes) and 30 hashes

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter [M]byte

func DecodeBase64

func DecodeBase64(s string) (*Filter, error)

func (*Filter) Add

func (f *Filter) Add(element []byte)

func (Filter) Copy

func (f Filter) Copy() *Filter

func (Filter) EncodeBase64

func (f Filter) EncodeBase64() string

func (Filter) Equals

func (f Filter) Equals(b Filter) bool

func (Filter) Has

func (f Filter) Has(element []byte) bool

func (*Filter) Saturate

func (f *Filter) Saturate() error

Jump to

Keyboard shortcuts

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