Skip to content

faruken/rust-bloom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

rust-bloom

rust-bloom is a bloom filter implementation in rust that uses farmhash.

Example Usage

extern crate bloom;

use bloom::BloomFilter;

fn main() {
    let mut bf = BloomFilter::new(10_000, 0.02);
    bf.insert(&"hello");
    bf.insert(&"abcd");

    match bf.has(&"hello") {
        true => println!("exists"),
        _ => println!("not exists"),
    }
}

Use Cases

  • If you're writing a spider, you can do "have I discovered this URL" efficiently.
  • It's also how "this username is already taken" works on high traffic websites.

Note that there can be false positives.

Releases

No releases published

Packages

No packages published

Languages