https://github.com/beastop/bloomfilter
BloomFilter is a simple and efficient implementation of a Bloom filter in Go.
https://github.com/beastop/bloomfilter
algorithms bloom-filter bloomfilter bloomfilter-go data-structures go golang
Last synced: about 1 year ago
JSON representation
BloomFilter is a simple and efficient implementation of a Bloom filter in Go.
- Host: GitHub
- URL: https://github.com/beastop/bloomfilter
- Owner: beastOP
- License: mit
- Created: 2024-07-15T09:37:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-15T10:44:00.000Z (over 1 year ago)
- Last Synced: 2025-01-07T23:49:32.849Z (about 1 year ago)
- Topics: algorithms, bloom-filter, bloomfilter, bloomfilter-go, data-structures, go, golang
- Language: Go
- Homepage: https://pkg.go.dev/github.com/beastop/bloomfilter
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BloomFilter
[](https://github.com/beastop/bloomfilter/actions)
[](https://pkg.go.dev/github.com/beastop/bloomfilter)
BloomFilter is a simple and efficient implementation of a Bloom filter in Go.
## Installation
To install the package, run:
```sh
go get github.com/beastop/bloomfilter
```
## Usage
### Creating a Bloom Filter
```go
package main
import (
"fmt"
"github.com/beastop/bloomfilter"
)
func main() {
// Create a new Bloom filter
bloom, err := bloomfilter.New(100, 0.01)
if err != nil {
fmt.Println("Error:", err)
return
}
// Add items to the Bloom filter
bloom.Add("foo")
bloom.Add("bar")
// Check if items are in the Bloom filter
fmt.Println("foo in bloom filter:", bloom.Contains("foo"))
fmt.Println("baz in bloom filter:", bloom.Contains("baz"))
}
```
## Documentation
For detailed API documentation, please visit the [GoDoc](https://pkg.go.dev/github.com/beastop/bloomfilter).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.