{"id":19494710,"url":"https://github.com/ceejbot/seabloom","last_synced_at":"2025-07-07T17:33:20.128Z","repository":{"id":57666453,"uuid":"75153000","full_name":"ceejbot/seabloom","owner":"ceejbot","description":"Yet Another Bloom Filter, this one using seahash.","archived":false,"fork":false,"pushed_at":"2016-11-30T06:07:32.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T14:16:31.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","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":"2016-11-30T04:59:31.000Z","updated_at":"2018-04-22T09:07:51.000Z","dependencies_parsed_at":"2022-09-26T20:31:48.444Z","dependency_job_id":null,"html_url":"https://github.com/ceejbot/seabloom","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/ceejbot%2Fseabloom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fseabloom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fseabloom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fseabloom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceejbot","download_url":"https://codeload.github.com/ceejbot/seabloom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224018349,"owners_count":17242052,"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:12.890Z","updated_at":"2024-11-10T21:33:05.823Z","avatar_url":"https://github.com/ceejbot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seabloom\n\nYet Another Bloom Filter, this one using [seahash](https://github.com/ticki/tfs/tree/master/seahash).\n\n[![Build Status](https://travis-ci.org/ceejbot/seabloom.svg?branch=master)](https://travis-ci.org/ceejbot/seabloom) [![cargo](https://crates.io/crates/seabloom)](https://img.shields.io/crates/v/seabloom.svg)\n\n## Usage\n\n```rust\nextern crate seabloom;\n\nlet mut filter = Seabloom::create(2000);\n\nassert_eq!(filter.has(\"cat\"), false);\nfilter.add(\"cat\");\nassert_eq!(filter.has(\"cat\"), true);\n\nfilter.add_list(vec![\"cat\", \"jaguar\", \"lion\", \"tiger\", \"leopard\"]);\nassert_eq!(filter.has(\"caracal\"), false);\nassert_eq!(filter.has(\"jaguar\"), true);\n\nfilter.clear();\nassert_eq!(filter.has(\"cat\"), false);\n```\n\n## API\n\n`Seabloom::create(item_count: u32) -\u003e Seabloom`\n\nCreate a Bloom filter sized for the given item count with an error rate of 0.5% (0.005). Seeds for the hashing functions will be generated randomly for you.\n\n`Seabloom::create_optimal(item_count: u32, error_rate: f32) -\u003e Seabloom`\n\nCreate a Bloom filter sized for the given item count with the specified error rate.  Seeds for the hashing functions will be generated randomly for you.\n\n`Seabloom::create_random_seeds(bitcount: u64, hashcount: u32) -\u003e Seabloom`\n\nCreate a Bloom filter with the given number of bits for storage and the given number of hashing functions. Seeds for the hashing functions will be generated randomly for you. You probably don't want to use this function; use `create` instead.\n\n`Seabloom::new(bitcount: u64, seeds: Vec\u003cu64\u003e) -\u003e Seabloom`\n\nCreate a Bloom filter with the given number of bits for storage and hashing functions using the seeds you provide. You need 4x the number of seeds as hashing functions for seahash's current API.\n\n`filter.clear()`\n\nClear the filter.\n\n`filter.add(item: \u0026str)`\n\nAdd a string to the filter.\n\n`filter.add_bytes(bytes: \u0026[u8])`\n\nAdd an item represented by the given bytes to the filter.\n\n`filter.add_list(items: Vec\u003c\u0026str\u003e)`\n\nAdd a list of strings to the filter.\n\n`filter.has(item: \u0026str) -\u003e bool`\n\nCheck to see if the given string is in the filter. Provides a definitive no or a maybe-yes.\n\n`filter.has_bytes(bytes: \u0026[u8]) -\u003e bool`\n\nCheck to see if the given pile-o-bytes is in the filter. Provides a definitive no or a maybe-yes.\n\n## License\n\nISC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fseabloom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceejbot%2Fseabloom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fseabloom/lists"}