All Projects → bculberson → bloom

bculberson / bloom

Licence: Apache-2.0 license
Bloom filter for go, backed by redis

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to bloom

bloofi
Bloofi: A java implementation of multidimensional Bloom filters
Stars: ✭ 68 (+83.78%)
Mutual labels:  bloom-filters
bloom
An in-memory bloom filter with persistence and HTTP interface
Stars: ✭ 31 (-16.22%)
Mutual labels:  bloom-filters
Olivia
Go: A distributed, in-memory key-value storage.
Stars: ✭ 94 (+154.05%)
Mutual labels:  bloom-filters
bloomfilter
Bloom filters for Java
Stars: ✭ 53 (+43.24%)
Mutual labels:  bloom-filters
hackernews-button
Privacy-preserving Firefox extension linking to Hacker News discussion; built with Bloom filters and WebAssembly
Stars: ✭ 73 (+97.3%)
Mutual labels:  bloom-filters
libfilter
High-speed Bloom filters and taffy filters for C, C++, and Java
Stars: ✭ 23 (-37.84%)
Mutual labels:  bloom-filters
bloomfilter
bloomfilter.js ported to Go
Stars: ✭ 94 (+154.05%)
Mutual labels:  bloom-filters
bloom
Go package implementing Bloom filters
Stars: ✭ 1,752 (+4635.14%)
Mutual labels:  bloom-filters
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+51.35%)
Mutual labels:  bloom-filters

Bloom Filters for Golang

Bloom filter for go, backed by redis or in process bitset

If you are not familiar with how Bloom filters work and their usefulness, please read.

Build Status

Example Usage (in process):

install with

go get gopkg.in/bculberson/bloom.v2

go import ( "gopkg.in/bculberson/bloom.v2" )

This bloom filter is initialized to hold 1000 keys and will have a false positive rate of 1% (.01).

m, k := bloom.EstimateParameters(1000, .01)
b := bloom.New(m, k, bloom.NewBitSet(m))
b.Add([]byte("some key"))
exists, _ := b.Exists([]byte("some key"))
doesNotExist, _ := b.Exists([]byte("some other key"))

Example Usage (redis backed):

This bloom filter is initialized to hold 1000 keys and will have a false positive rate of 1% (.01).

This library uses http://github.com/garyburd/redigo/redis

pool := &redis.Pool{
    MaxIdle:     3,
    IdleTimeout: 240 * time.Second,
    Dial:        func() (redis.Conn, error) { return redis.Dial("tcp", addr) },
}


conn := pool.Get()
m, k := bloom.EstimateParameters(1000, .01)
bitSet := bloom.NewRedisBitSet("test_key", m, conn)
b := bloom.New(m, k, bitSet)
b.Add([]byte("some key"))
exists, _ := b.Exists([]byte("some key"))
doesNotExist, _ := b.Exists([]byte("some other key"))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].