| Crates.io | bloom_filter |
| lib.rs | bloom_filter |
| version | 0.1.0 |
| created_at | 2016-12-12 01:24:53.73052+00 |
| updated_at | 2016-12-12 01:24:53.73052+00 |
| description | A bloom filter implementation |
| homepage | https://github.com/jeromefroe/bloom_filter |
| repository | https://github.com/jeromefroe/bloom_filter.git |
| max_upload_size | |
| id | 7546 |
| size | 13,643 |
An implementation of a bloom filter as as described in [Space/Time Trade-offs in Hash Coding with Allowable Errors] (http://dmod.eu/deca/ft_gateway.cfm.pdf).
extern crate bloom_filter;
use bloom_filter::BloomBuilder;
fn main() {
let elements = 2u64.pow(20);
let fpr = 0.01;
let mut bloom = BloomBuilder::new(elements).with_fpr(fpr).finish().unwrap();
bloom.insert("foo");
bloom.insert("bar");
bloom.insert("baz");
if bloom.lookup("foo") {
println!("found foo in the bloom filter");
}
}