bloom

package
v0.4.11-pre Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package bloom implements a simple bloom filter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Add([]byte)
	Find([]byte) bool
	Merge(Filter) (Filter, error)
	HammingDistance(Filter) (int, error)
}

A Filter represents a bloom filter.

func BasicFilter

func BasicFilter() Filter

BasicFilter calls NewFilter with a bloom filter size of 2048 bytes.

func NewFilter

func NewFilter(size int) Filter

NewFilter creates a new bloom Filter with the given size. k (the number of hash functions), is hardcoded to 3.

Jump to

Keyboard shortcuts

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