Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 5 items with examples
  • Size
  • Source code size: 7.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 293.74 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • blackredscarf

Bloom Filter

Bloom filter is a data structure that can check the element whether exists in a certain collection or not. But It probably checks in error and we call those false positive matches. More generally, average fewer than 10 bits per element are required for a 1% false positive probability, independent of the size or number of elements in the set.

Usage

let mut bf = BloomFilter::new(10);
let b1 = Bytes::from(&b"hello"[..]);
let b2 = Bytes::from(&b"world"[..]);

bf.add(&b1);
let filter = bf.generate();
println!("{}", bf.contains(&filter, &b1)); // true
println!("{}", bf.contains(&filter, &b2)); // false

References