https://github.com/rossmerr/bloomfilter
Bloom Filter
https://github.com/rossmerr/bloomfilter
bloomfilter go golang
Last synced: 5 months ago
JSON representation
Bloom Filter
- Host: GitHub
- URL: https://github.com/rossmerr/bloomfilter
- Owner: rossmerr
- License: mit
- Created: 2023-03-07T08:15:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T12:28:18.000Z (over 3 years ago)
- Last Synced: 2024-06-21T11:49:57.462Z (about 2 years ago)
- Topics: bloomfilter, go, golang
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bloom Filter
[](https://github.com/rossmerr/bloomfilter/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/rossmerr/bloomfilter)
[](https://pkg.go.dev/github.com/rossmerr/bloomfilter)
## Usage
define your struct implementing the [Hash](hash.go) interface defined in this module.
```go
type Test struct {
}
func (s *Test) Sum() uint {
// your hash function...
}
```
```go
obj := &Test{}
filter := bloomfilter.NewFilterOptimal[*Test](2000000)
filter.Add(obj)
match := filter.Contains(obj)
fmt.Println(match) // true
```