Skip to content

darkLord19/bloomfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bloomfilter

GoDoc

A Bloom filter is a data structure designed to tell you, rapidly and memory-efficiently, whether an element is present in a set. The price paid for this efficiency is that a Bloom filter is a probabilistic data structure: it tells us that the element either definitely is not in the set or may be in the set.

Installation

go get -u github.com/darklord19/bloomfilter

Import

import "github.com/darkLord19/bloomfilter"

Usage

// NewBloomFilter accepts three arguments. First is number of elements you want to track,
// second is acceptable false positive probability, and third is hash you want to use(it must implement hash64 interface)
bf := bloomfilter.NewBloomFilter(10000, 0.10, fnv.New64()) 
bf.Add([]byte("A"))
bf.Add([]byte("B"))
res, err := bf.DoesNotExist([]byte("C"))
elems := bf.GetElementsEstimate()

About

bloomfilter data structure implemented in go as a package.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages