Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hengfeiyang/bloomfilter

bloomfilter use roaring bitmap
https://github.com/hengfeiyang/bloomfilter

Last synced: about 2 months ago
JSON representation

bloomfilter use roaring bitmap

Awesome Lists containing this project

README

        

# bloomfilter

a bloomfilter implement with roaring bitmap.

Usage:

```
package main

import (
"fmt"

"github.com/safeie/bloomfilter"
)

func main() {
cfg := bloomfilter.Config{
N: 1000000, // capacity
P: 0.00001, // false probability
HashName: bloomfilter.HASHER_OPTIMAL, // hash functions
}
bf := bloomfilter.New(cfg, bloomfilter.NewRoaring(cfg))
bf.Add([]byte("www.google.com"))
bf.Add([]byte("twitter.com"))
bf.Add([]byte("github.com"))

fmt.Println(bf.Check([]byte("twitter.com")))
fmt.Println(bf.Check([]byte("facebook.com")))
}
```