{"id":25131942,"url":"https://github.com/robotomize/go-bf","last_synced_at":"2026-05-15T23:03:35.966Z","repository":{"id":223533783,"uuid":"760625208","full_name":"robotomize/go-bf","owner":"robotomize","description":"Go package that provides an implementation of a Bloom filter","archived":false,"fork":false,"pushed_at":"2024-02-21T09:11:00.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T00:11:37.464Z","etag":null,"topics":["bitset","bitset-library","bloom-filter","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotomize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-20T16:31:22.000Z","updated_at":"2024-02-20T18:04:02.000Z","dependencies_parsed_at":"2024-02-20T19:26:09.612Z","dependency_job_id":"dce34571-2e86-4f93-a108-3f96ce2be060","html_url":"https://github.com/robotomize/go-bf","commit_stats":null,"previous_names":["robotomize/go-bf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robotomize/go-bf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotomize%2Fgo-bf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotomize%2Fgo-bf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotomize%2Fgo-bf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotomize%2Fgo-bf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotomize","download_url":"https://codeload.github.com/robotomize/go-bf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotomize%2Fgo-bf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264887603,"owners_count":23678713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitset","bitset-library","bloom-filter","golang"],"created_at":"2025-02-08T14:16:02.035Z","updated_at":"2026-05-15T23:03:30.934Z","avatar_url":"https://github.com/robotomize.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-bf\n\ngo-bf is a Go package that provides an implementation of a Bloom filter. A Bloom filter is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. It is capable of telling you if an element might be in the set or it is definitely not in the set.\n\n## Features\n* Customizable Hash Functions: The package allows you to specify custom hash functions or use the default FNV-1a hash function.\n* Configurable Hash Count: You can configure the number of hash functions to use for the Bloom filter.\n* Concurrency-Safe(???): The package is designed to be safe for concurrent use, but you should ensure that the hash functions you provide are also safe for concurrent use.\n\n## Installation\nTo install the package, run:\n```shell\ngo get github.com/robotomize/go-bf/bf/bfbits\n```\n\n## Usage\nTo use bfbits, you need to import the package and create a new Bloom filter with the desired size and options.\n\n```go\n// Create a new Bloom filter with the default settings.\nbf := bfbits.NewBloomFilter(10000)\n\n// Add an item to the Bloom filter.\nerr := bf.Add([]byte(\"apple\"))\nif err != nil {\n    log.Fatal(err)\n}\n\n// Check if an item is in the Bloom filter.\ncontains, err := bf.Contains([]byte(\"apple\"))\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Printf(\"item exist: %t\", contains)\n```\n## Options\nYou can customize the behavior of the Bloom filter by providing options when creating it.\n```go\n// Create a Bloom filter with a custom hash function and hash count.\ncustomHashFunc := func() hash.Hash64 {\n    return fnv.New64a()\n}\nbf := bfbits.NewBloomFilter(10000, bfbits.WithHasher(customHashFunc), bfbits.WithHashNum(2))\n```\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotomize%2Fgo-bf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotomize%2Fgo-bf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotomize%2Fgo-bf/lists"}