{"id":22750186,"url":"https://github.com/terenstare/modern_bloom","last_synced_at":"2025-04-14T12:54:56.965Z","repository":{"id":222383164,"uuid":"757125202","full_name":"TerensTare/modern_bloom","owner":"TerensTare","description":"Bloom filters for modern C++.","archived":false,"fork":false,"pushed_at":"2024-03-06T13:52:28.000Z","size":60,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:05:17.936Z","etag":null,"topics":["bloom-filter","cpp","cpp17"],"latest_commit_sha":null,"homepage":"","language":"C++","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/TerensTare.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-02-13T21:16:54.000Z","updated_at":"2024-03-14T13:32:28.000Z","dependencies_parsed_at":"2024-02-28T18:55:11.781Z","dependency_job_id":null,"html_url":"https://github.com/TerensTare/modern_bloom","commit_stats":null,"previous_names":["terenstare/modern_bloom"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerensTare%2Fmodern_bloom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerensTare%2Fmodern_bloom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerensTare%2Fmodern_bloom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerensTare%2Fmodern_bloom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TerensTare","download_url":"https://codeload.github.com/TerensTare/modern_bloom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248885677,"owners_count":21177627,"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":["bloom-filter","cpp","cpp17"],"created_at":"2024-12-11T04:12:50.407Z","updated_at":"2025-04-14T12:54:56.929Z","avatar_url":"https://github.com/TerensTare.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Bloom filters for modern C++\n\nThis repo contains a simple implementation of a bloom filter in C++17.\n\n\n## Introduction\n\nA bloom filter is a probabilistic data structure that is used to test whether an element is a member of a set. False positives are possible, but false negatives are not. Elements can be added to the set, but not removed.\n\n\n## Usage\n\n```cpp\n#include \u003cdynamic_bloom.hpp\u003e\n\nstruct my_article final\n{\n    std::string title;\n    std::string author;\n    std::string content;\n};\n\nstruct article_hash final\n{\n    inline std::size_t operator()(my_article const\u0026 article) const noexcept\n    {\n        return std::hash\u003cstd::string\u003e{}(article.title);\n    }\n};\n\nint main()\n{\n    // Assume that the average user can read 1000 articles on average.\n    tnt::dynamic_bloom\u003cmy_article, article_hash\u003e read_articles(1'000);\n\n    // Our user reads an article.\n    my_article article1{\"The C++ Programming Language\", \"Bjarne Stroustrup\", \"The C++ Programming Language is a computer programming book first published in October 1985.\"};\n\n    read_articles.insert(article1);\n\n    std::vector\u003cmy_article\u003e suggestions;\n\n    for (auto const \u0026article : \u003clist-of-all-articles\u003e)\n    {\n        if (!read_articles.matches(article))\n        {\n            // Add non-read articles to the suggestions list.\n            suggestions.push_back(article);\n        }\n    }\n}\n```\n\n\n## Integration\n\nThis is a header-only library. You can use it by simply copying the files in the `include` directory to your project. Then include one of the header files in your source code as following.\n\n```cpp\n// for fixed-size bloom filter\n#include \u003cstatic_bloom.hpp\u003e // tnt::static_bloom\n\n// for dynamically-sized bloom filter\n#include \u003cdynamic_bloom.hpp\u003e // tnt::dynamic_bloom\n```\n\n\n## Requirements\n\nThe library is written in C++17, so you need a compiler that supports at least C++17. However, the tests are written in C++20, so you need a compiler that supports at least C++20 to run the tests. Furthermore, you need CMake 3.14 or newer to build the tests.\n\n\n## Tests\n\nTo run the tests, you need to have CMake 3.14 or newer installed on your system. Then, you can run the following commands.\n\n```bash\nmkdir build\ncd build\ncmake ..\ncmake --build . --target run_tests\n```\n\n## License\n\nCode is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterenstare%2Fmodern_bloom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterenstare%2Fmodern_bloom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterenstare%2Fmodern_bloom/lists"}