Skip to content

Simple bloom filter implementation for the GoLang programming language

License

Notifications You must be signed in to change notification settings

scottjr632/go-bloom-filter

Repository files navigation

GoLang Bloom Filter

codecov CircleCI

Simple bloom filter implementation for the GoLang programming language

Installing

go get github.com/scottjr632/go-bloom-filter

Importing

import "github.com/scottjr632/go-bloom-filter"

Creating a new optimal filter

estimatedNumberOfItems, maxFailureRate := 3000, 0.01
bf := bloomfilter.NewFromEstimate(estimatedNumberOfItems, maxFailureRate)

Creating a new filter

sizeOfFilter, numHashFns := 128, 3
bf := bloomfilter.New(sizeOfFilter, numHashFns)

Handling values

Adding a value to the filter

valueToAdd := 'https://maliciousurl.xyz'
bf.Add(valueToAdd)

Checking if a value has been set

valueToCheck := 'https://maliciousurl.xyz'
bf.Check(valueToCheck) // -> true

bf.Check('value that has not been set') // -> false

About

Simple bloom filter implementation for the GoLang programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages