bloom

package
v0.0.0-...-6b33518 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: AGPL-3.0-or-later, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package bloom implements Bloom filters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Optimal

func Optimal(numElements int, falsePositiveRate float64) (sizeBits int, numHashes int)

Optimal computes optimal Bloom filter parameters. These parameters are optimal for small bloom filters as described in section 4.1 of this paper:

https://web.stanford.edu/~ashishg/papers/inverted.pdf

Types

type Filter

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

func New

func New(sizeBits int, numHashes int) *Filter

func (*Filter) Len

func (f *Filter) Len() int

func (*Filter) MarshalBinary

func (f *Filter) MarshalBinary() ([]byte, error)

func (*Filter) MarshalJSON

func (f *Filter) MarshalJSON() ([]byte, error)

func (*Filter) NumHashes

func (f *Filter) NumHashes() int

func (*Filter) Set

func (f *Filter) Set(x []byte)

func (*Filter) Test

func (f *Filter) Test(x []byte) bool

func (*Filter) UnmarshalBinary

func (f *Filter) UnmarshalBinary(data []byte) error

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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