{"id":21760010,"url":"https://github.com/zanonnicola/b-filter","last_synced_at":"2026-05-11T04:47:59.007Z","repository":{"id":34994444,"uuid":"194270724","full_name":"zanonnicola/b-filter","owner":"zanonnicola","description":"Javascript implementation of Bloom Filters written in TypeScript","archived":false,"fork":false,"pushed_at":"2023-01-04T01:30:09.000Z","size":3246,"stargazers_count":1,"open_issues_count":18,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T01:34:19.314Z","etag":null,"topics":["algorithms-and-data-structures","javascript","library","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanonnicola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T12:31:37.000Z","updated_at":"2023-03-10T08:30:58.000Z","dependencies_parsed_at":"2023-01-15T11:45:20.810Z","dependency_job_id":null,"html_url":"https://github.com/zanonnicola/b-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanonnicola%2Fb-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanonnicola%2Fb-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanonnicola%2Fb-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanonnicola%2Fb-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanonnicola","download_url":"https://codeload.github.com/zanonnicola/b-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244734199,"owners_count":20501020,"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":["algorithms-and-data-structures","javascript","library","typescript"],"created_at":"2024-11-26T11:36:52.990Z","updated_at":"2026-05-11T04:47:53.983Z","avatar_url":"https://github.com/zanonnicola.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# B-filters\n\nJavascript implementation of [Bloom Filters](http://en.wikipedia.org/wiki/Bloom_filter)\n\n\u003e A Bloom filter is a space-efficient probabilistic data structure, conceived by Burton Howard Bloom in 1970, that is used to test whether an element is a member of a set. False positive matches are possible, but false negatives are not. Elements can only be be added to the set.\n\n## :package: Installation\n\n```bash\nnpm i @zanonnicola/b-filter\n```\n\n## :rocket: Load\n\n```js\n// using es modules\nimport bfilter from '@zanonnicola/b-filter';\nconst BloomFilter = bFilter.default;\n\n// common.js\nconst bfilter = require('@zanonnicola/b-filter');\nconst BloomFilter = bFilter.default;\n\n// UMD\nconst bfilter = bfilter.default;\n```\n\n## :bulb: Usage\n\n```js\n//...n numbers of items\nconst data = ['word 1', 'my second word 2', 'random chars 3'];\nconst filter = new BloomFilter(data.length);\n\nfor (const item in data) {\n  filter.add(item);\n}\n\nfilter.test('word 1'); // true (probably)\nfilter.test('random'); // false\n```\n\n## API\n\n#### `BloomFilter(size: number, falsePositiveRate: number);` Default `falsePositiveRate` 0.005\n\n`BloomFilter.test(item: string)` returns `boolean`\n\n## Local Development\n\nBelow is a list of commands you will probably find useful.\n\n### `npm start` or `yarn start`\n\nRuns the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.\n\n### `npm run build` or `yarn build`\n\nBundles the package to the `dist` folder.\n\n### `npm test` or `yarn test`\n\nRuns the test watcher (Jest) in an interactive mode.\nBy default, runs tests related to files changed since the last commit.\n\nThis project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanonnicola%2Fb-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanonnicola%2Fb-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanonnicola%2Fb-filter/lists"}