{"id":20123297,"url":"https://github.com/citizen428/bloom_filter","last_synced_at":"2026-06-04T22:31:07.463Z","repository":{"id":66865266,"uuid":"106194021","full_name":"citizen428/bloom_filter","owner":"citizen428","description":"Bloom filters for Crystal","archived":false,"fork":false,"pushed_at":"2017-10-24T07:41:32.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T04:06:51.048Z","etag":null,"topics":["bloom-filter","bloom-filters","crystal"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/citizen428.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":"2017-10-08T17:05:13.000Z","updated_at":"2019-03-08T14:13:45.000Z","dependencies_parsed_at":"2023-04-20T12:18:06.719Z","dependency_job_id":null,"html_url":"https://github.com/citizen428/bloom_filter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/citizen428/bloom_filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citizen428%2Fbloom_filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citizen428%2Fbloom_filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citizen428%2Fbloom_filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citizen428%2Fbloom_filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/citizen428","download_url":"https://codeload.github.com/citizen428/bloom_filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citizen428%2Fbloom_filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33923173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bloom-filter","bloom-filters","crystal"],"created_at":"2024-11-13T19:44:13.010Z","updated_at":"2026-06-04T22:31:07.438Z","avatar_url":"https://github.com/citizen428.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BloomFilter and BloomFilter::Scalable\n\n[Bloom filters](http://en.wikipedia.org/wiki/Bloom_filter) for Crystal. Inspired by and based on [bloomer](https://github.com/mceachen/bloomer) by [Matthew McEachen](https://github.com/mceachen) and [bloomfilter-rb](https://github.com/igrigorik/bloomfilter-rb) by [Ilya Grigorik](https://github.com/igrigorik).\n\nBloom filters (`BloomFilter`) are space-efficient probabilistic data structures. They allow to quickly check if a given string has been seen before. There are no false negatives, but false positives are possible and their maximum probability can be specified. Bloom filters work in constant time and using constant memory, as long as the expected number of elements is known in advance. If this number is later exceeded, the accuracy will drop below the initally defined false positive probabiltiy. This implementation borrows Ilya Grigorik's CRC32-based hash implementation, so the same caveats apply.\n\n\u003e [T]his implementation seeds the CRC32 hash with k different initial values (0, 1, ..., k-1). This may or may not give you a good distribution, it all depends on the data.\n\nThe required number of hash functions is automatically calculated from the filter's capacity and the desired maximum false positive rate, see the [Bloom filter calculator](https://hur.st/bloomfilter) for details regarding the calculations.\n\nScalable Bloom filters (`BloomFilter::Scalable`) maintain a maximal false positive probability by increasing their memory usage as needed.\n\nFor ideas what to do with Bloom filters, check [Bloom Filters for the Perplexed](https://sagi.io/2017/07/bloom-filters-for-the-perplexed/) by [Sagi Kedmi](https://sagi.io).\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  bloom_filter:\n    github: citizen428/bloom_filter\n```\n\n## Usage\n\n```crystal\nrequire \"bloom_filter\"\nb = BloomFilter.new(10000, 0.0001)\nb.add(\"a\")      #=\u003e true\nb.count         #=\u003e 1\nb.add(\"a\")      #=\u003e false\nb.include?(\"a\") #=\u003e true\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/citizen428/bloom_filter/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [citizen428](https://github.com/citizen428) Michael Kohl - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitizen428%2Fbloom_filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitizen428%2Fbloom_filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitizen428%2Fbloom_filter/lists"}