Skip to content

MilosSimic/Bloomfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloomfilter

implementation of standard bloom filter algorithm

Usage:

package main

import (
	"fmt"
	"github.com/MilosSimic/bloomfilter"
)

func main() {
	bf := bloomfilter.New(300000, 0.01)
	bf.Add("Dog")
	bf.Add("Cat")

	fmt.Println("Test Dog [true]:", bf.Test("Dog"))
	fmt.Println("Test Cat [true]:", bf.Test("Cat"))
	fmt.Println("Test John[false]:", bf.Test("John"))
	fmt.Println("Test Doe[false]:", bf.Test("Doe"))

	bf.Add("Pig")
	bf.Add("Mice")
	bf.Add("John")

	fmt.Println("Test Pig [true]:", bf.Test("Pig"))
	fmt.Println("Test Mice [true]:", bf.Test("Mice"))
	fmt.Println("Test John[true]:", bf.Test("John"))
	fmt.Println("Test Mick[false]:", bf.Test("Mick"))
}

About

implementation of standard bloom filter algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages