{"id":19494732,"url":"https://github.com/ceejbot/xxbloom","last_synced_at":"2025-07-09T01:42:18.515Z","repository":{"id":57402516,"uuid":"105082734","full_name":"ceejbot/xxbloom","owner":"ceejbot","description":null,"archived":false,"fork":false,"pushed_at":"2017-09-28T04:15:33.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T03:56:40.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ceejbot.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}},"created_at":"2017-09-28T00:19:12.000Z","updated_at":"2022-01-11T09:26:58.000Z","dependencies_parsed_at":"2022-09-17T07:02:11.639Z","dependency_job_id":null,"html_url":"https://github.com/ceejbot/xxbloom","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fxxbloom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fxxbloom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fxxbloom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fxxbloom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceejbot","download_url":"https://codeload.github.com/ceejbot/xxbloom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240740207,"owners_count":19849908,"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":[],"created_at":"2024-11-10T21:32:43.991Z","updated_at":"2025-02-25T20:26:04.923Z","avatar_url":"https://github.com/ceejbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yet another Bloom filter implementation for node.js. Everybody has to write one, as you know. Backed by [Xxhash](https://code.google.com/p/xxhash/) via [xxhashjs](https://github.com/pierrec/js-xxhash). Xxhash is a fast general-purpose hash, which is all a bloom filter needs.\n\nTo install: `npm install xxbloom`\n\n[![on npm](https://img.shields.io/npm/v/xxbloom.svg?style=flat)](https://www.npmjs.com/package/xxbloom) [![Build Status](http://img.shields.io/travis/ceejbot/xx-bloom/master.svg?style=flat)](https://travis-ci.org/ceejbot/xxbloom) [![Coverage Status](https://img.shields.io/coveralls/ceejbot/xx-bloom.svg?style=flat)](https://coveralls.io/github/ceejbot/xxbloom?branch=master)\n\n## Usage\n\n### BloomFilter\n\nTo create a filter, pass an options hash to the constructor:\n\n```javascript\nvar options =\n{\n\tbits: 1024,\n\thashes: 7,\n\tseeds: [1, 2, 3, 4, 5, 6, 7]\n};\nfilter = new BloomFilter(options);\n```\n\nYou can pass in seeds for the hash functions if you like, or they'll be randomly generated. Seeds must be integers.\n\nYou may also pass in a buffer as generated by `filter.toBuffer()`.\n\n### createOptimal()\n\nTo create a filter optimized for the number of items you'll be storing and a desired error rate:\n\n`filter = BloomFilter.createOptimal(estimatedItemCount, errorRate);`\n\nThe error rate parameter is optional. It defaults to 0.005, or a 0.5% rate.\n\n### add()\n\n`filter.add('cat');`\n\nAdds the given item to the filter. Can also accept buffers and arrays containing strings or buffers:\n\n`filter.add(['cat', 'dog', 'coati', 'red panda']);`\n\n### has()\n\nTo test for membership:\n\n`filter.has('dog');`\n\n### clear()\n\nTo clear the filter:\n\n`filter.clear();`\n\n### toBuffer()\n\nReturns a buffer with seeds and filter data.\n\n### fromBuffer()\n\nReconstitutes a filter from a freeze-dried buffer.\n\n## Licence\n\nISC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fxxbloom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceejbot%2Fxxbloom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fxxbloom/lists"}