bloom

package
v0.0.0-...-7f3037c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitArray

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

func NewBitArray

func NewBitArray(length uint64) *BitArray

* Creates a New Bit Array of specified length

func (*BitArray) Clear

func (ba *BitArray) Clear(index uint64)

* Clears bit in a particular index

func (*BitArray) IsSet

func (ba *BitArray) IsSet(index uint64) bool

* Returns true is bit is set in a particular index

func (*BitArray) Set

func (ba *BitArray) Set(index uint64)

* Sets bit in a particular index

type BloomFilter

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

func New

func New(insertionCount uint64, falsePositiveProbability float64) *BloomFilter

* Create new BloomFilter with approximate unique keys insertion count and tolerated false positive probability

func NewWithSize

func NewWithSize(numberOfBits uint64, hashFunctions int) *BloomFilter

* Create new BloomFilter with number of bits and hash functions to use

func (*BloomFilter) MightContain

func (bf *BloomFilter) MightContain(key string) bool

* Check if bloom filter might contain string key Can give false positives. But if returns false key is definitely not present

func (*BloomFilter) MightContainBytes

func (bf *BloomFilter) MightContainBytes(key []byte) bool

* Check if bloom filter might contain bytes key Can give false positives. But if returns false key is definitely not present

func (*BloomFilter) Put

func (bf *BloomFilter) Put(key string)

* Put the string key in bloom filter

func (*BloomFilter) PutBytes

func (bf *BloomFilter) PutBytes(key []byte)

* Put the bytes key in bloom filter

Jump to

Keyboard shortcuts

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