https://github.com/sysatom/go_bloom_filter
A Simple Bloom Filter for Go
https://github.com/sysatom/go_bloom_filter
bloom-filter golang
Last synced: 11 months ago
JSON representation
A Simple Bloom Filter for Go
- Host: GitHub
- URL: https://github.com/sysatom/go_bloom_filter
- Owner: sysatom
- License: mit
- Created: 2020-03-19T06:14:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-19T07:44:17.000Z (over 6 years ago)
- Last Synced: 2024-06-20T16:11:12.517Z (about 2 years ago)
- Topics: bloom-filter, golang
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Simple Bloom Filter for Go
[](https://travis-ci.org/sysatom/go-bloom-filter)
### Install
```bash
go get github.com/sysatom/go_bloom_filter
```
### Usage
```go
package main
import (
"fmt"
"github.com/sysatom/go_bloom_filter"
)
func main() {
bf := go_bloom_filter.NewBloomFilter(100000, 7)
for i := 0; i < 5000; i++ {
bf.Add(fmt.Sprintf("%d", i))
}
fmt.Println(bf.Lookup("333"))
fmt.Println(bf.Lookup("100000"))
fmt.Println(bf.Lookup("500001"))
fmt.Println(bf.Lookup("510001"))
}
```
### Requirements
This project requires Go 1.14 or newer.
### License
You can find the license for this code in [the LICENSE file](LICENSE).