{"id":47444137,"url":"https://github.com/johnmyleswhite/BloomFilters.jl","last_synced_at":"2026-04-06T13:00:58.718Z","repository":{"id":6684234,"uuid":"7929282","full_name":"johnmyleswhite/BloomFilters.jl","owner":"johnmyleswhite","description":"Bloom filters in Julia","archived":false,"fork":false,"pushed_at":"2019-07-11T21:14:14.000Z","size":32,"stargazers_count":18,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-01T20:19:19.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnmyleswhite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-31T03:09:45.000Z","updated_at":"2023-11-24T03:00:52.000Z","dependencies_parsed_at":"2022-08-20T07:10:28.953Z","dependency_job_id":null,"html_url":"https://github.com/johnmyleswhite/BloomFilters.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/johnmyleswhite/BloomFilters.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnmyleswhite%2FBloomFilters.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnmyleswhite%2FBloomFilters.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnmyleswhite%2FBloomFilters.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnmyleswhite%2FBloomFilters.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnmyleswhite","download_url":"https://codeload.github.com/johnmyleswhite/BloomFilters.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnmyleswhite%2FBloomFilters.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31473271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-03-23T06:00:59.902Z","updated_at":"2026-04-06T13:00:58.711Z","avatar_url":"https://github.com/johnmyleswhite.png","language":"Julia","funding_links":[],"categories":["Mathematics for Security"],"sub_categories":["Probabilistic Data Structures"],"readme":"# BloomFilters.jl\n\n[![Build Status](https://travis-ci.org/johnmyleswhite/BloomFilters.jl.png)](https://travis-ci.org/johnmyleswhite/BloomFilters.jl)\n\n*Please note: The API for version 0.1.0 of this package has changed substantially from version 0.0.1. Please review the below README and accompanying library documentation.*\n\n[Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter) implementation in [Julia](https://julialang.org). Supports insertion (`add!`) and probabilistic membership queries (`in`) for sets using an in-memory or mmap'd bit array. When an element `x` is inserted into a Bloom filter, set membership queries will always correctly return `true` for `x` (i.e., there are no false negatives). Bloom filter membership queries do, however, occassionally return `true` for a `y` not inserted into the data structure (i.e., false positives are possible). With this cost comes remarkable space efficiency: Bloom filters can store set membership using only 10 bits per element at a 1.00% error rate or 20 bits per element at a 0.01% error rate. This space requirement is irrespective of the size or length of the inserted elements (e.g., one can store a set of URLs using only a handful of bits per URL).\n\nForthcoming features include:\n\n* Better persistence (only the bit array is automatically saved when using the mmap-backed version; parameters must be separately stored or hard-coded)\n* Support for arbitrary numbers of hash functions (*k* \u003e 12)\n\n## Quickstart\n\nQuick functionality demo:\n\n```julia\nusing BloomFilters\n\n\nbf = BloomFilter(1000, 0.001)  # Create an in-memory Bloom filter\n\t\t\t\t\t\t\t   # with a capacity of 1K elements and\n\t\t\t\t\t\t\t   # expected error rate of 0.1%\n\nadd!(bf, \"My first element.\")\nin(\"My first element.\", bf)   # Returns true\nin(\"My second element.\", bf)  # Returns false\n\"My first element.\" in bf           # Returns true\nshow(bf)\n\n# Prints:\n# Bloom filter with capacity 1000, error rate of 0.10, and k of 10.\n# Total bits required: 15000 (15.0 / element).\n# Bloom filter is in-memory.\n\n```\n\nBy default, the Bloom filter will be constructed using an optimal number of k hash functions, which minimizes the expected false positive rate per required bit of storage. In many cases, however, it may be advantegous to specify a smaller value of k in order to save time hashing and performing subsequent memory accesses. Alternatively, one may want to explicitly set the number of bits to use per element _and_ k, rather than constructing the filter by passing a target error rate.\n\nThe `BloomFilters` module supports all 3 of these patterns:\n\n```julia\n# Constructor pattern #1: Pass capacity and error rate\nbf1 = BloomFilter(1000, 0.001)\n\n# Constructor pattern #2: Pass capacity, error rate, and k\nbf2 = BloomFilter(1000, 0.001, 6)  # vs. the optimal number of 10 if not specified as in bf1\n\n# Constructor pattern #3: Pass capacity, bits per element, and k, but not the error rate\nbf3 = BloomFilter(1000, 16, 6)  # Same as bf2, but will *not* compute the error rate and display NaN when show() is called\n```\n\nIn addition to this, basic persistence support is provided via optionally using an mmap-backed bit array. This works with each of the above methods by either passing a string of the mmap filepath or an `IOStream`:\n\n```julia\n### With an IOStream\n# Note that \"w+\" needs to be passed as the second argument to open() if creating\n# a new mmap-backed Bloom filter, or \"r+\" if opening an already created one\nbf4 = BloomFilter(open(\"/tmp/small_bloom_filter.array\", \"w+\"), 1000, 0.001)\n\n### With a string filepath\n# Note this creates the bit array if it doesn't exist or opens it if previously created\nbf5 = BloomFilter(\"/tmp/small_bloom_filter_two.array\", 1000, 0.001)\n\nshow(bf5)\n\n# Prints:\n# Bloom filter with capacity 1000, error rate of 0.10, and k of 10.\n# Total bits required: 15000 (15.0 / element).\n# Bloom filter is backed by mmap at \u003cfile /tmp/small_bloom_filter_two.array\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnmyleswhite%2FBloomFilters.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnmyleswhite%2FBloomFilters.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnmyleswhite%2FBloomFilters.jl/lists"}