bloom

package
v0.0.0-...-1422e27 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2014 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package bloom implements Bloom filters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter []byte

Filter is an encoded set of []byte keys.

func NewFilter

func NewFilter(buf []byte, keys [][]byte, bitsPerKey int) Filter

NewFilter returns a new Bloom filter that encodes a set of []byte keys with the given number of bits per key. The returned Filter may be a sub-slice of buf[:cap(buf)] if it is large enough, otherwise the Filter will be allocated separately.

func (Filter) MayContain

func (f Filter) MayContain(key []byte) bool

MayContain returns whether the filter may contain given key. False positives are possible, where it returns true for keys not in the original set.

Jump to

Keyboard shortcuts

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