Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hengfeiyang/bloomfilter
- Owner: hengfeiyang
- License: mit
- Created: 2021-12-18T16:37:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-19T08:03:31.000Z (about 3 years ago)
- Last Synced: 2023-07-12T18:08:11.022Z (over 1 year ago)
- Language: Go
- Size: 1.11 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bloomfilter
a bloomfilter implement with roaring bitmap.
Usage:
```
package mainimport (
"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")))
}
```