bloom

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

M3:2048 Bloom filter

Useful for reducing a log entry into a single 256-byte hash

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter [256]byte

Bloom filter implementation based on the Yellow Paper/4.3.1:

M3:2048 is a specialised Bloom filter that sets three
bits out of 2048, given an arbitrary byte sequence. It does
this through taking the low-order 11 bits of each of the
first three pairs of bytes in a Keccak-256 hash of the byte
sequence.

func (*Filter) Add

func (bf *Filter) Add(d []byte)

Sets appropriate bits in bf. Caller is responsible for keccak hashing d and concurrency control.

func (Filter) Missing

func (bf Filter) Missing(d []byte) bool

Returns true if the data isn't in the filter. Returns false when the data might be in the filter.

Caller is responsible for keccak hashing d

Jump to

Keyboard shortcuts

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