Skip to content

Go bloom filter with Murmur3 hash

License

Notifications You must be signed in to change notification settings

finalstrikegames/bloom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloom

This project bloom filter implementation using Murmur3 hash by github.com/spaolacci/murmur3.

Usage

Importing package

import "github.com/AccelByte/bloom"

Creating new bloom filter

// create new filter with size of 100
// with default Murmur3 hashing strategy
// and 1.e-5 expected false positive probability
b := bloom.New(100)

Putting item into bloom filter

b.Put([]byte("an_item"))

Checking if an item exists

b.MightContain([]byte("an_item"))

Exporting bloom filter to JSON

exported, _ := b.MarshalJSON()

Constructing bloom filter from exported JSON

bloomFilterJSON := &bloom.FilterJSON{}
json.Unmarshal(exported, bloomFilterJSON)
newB := bloom.From(bloomFilterJSON.B, bloomFilterJSON.K)

About

Go bloom filter with Murmur3 hash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%