Skip to content

jeromefroe/bloom_filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloom Filter

Build Status codecov crates.io docs.rs License

Documentation

An implementation of a bloom filter as as described in Space/Time Trade-offs in Hash Coding with Allowable Errors.

Example

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");
    }
}