Crate bloomcalc

source ·
Expand description

bloomcalc

bloomcalc provides a calculator for bloom filters.

Status

Maintenance track. The library is considered stable and will be put into maintenance mode if unchanged for one year.

Scope

This library provides the basics of a bloom filter with the bloomcalc command.

% target/debug/bloomcalc --prob 0.01
a bloom filter with false positive rate of 0.01 will work best with 6.643856189774724 keys

% target/debug/bloomcalc --card 1000 --prob 0.01
a bloom filter for 1000 items with false positive rate 0.01 will need 9585.058377367439 bits

% target/debug/bloomcalc --card 1000 --bits 10000
a bloom filter for 1000 items with 10000 bits will have a 0.008192549468178963 false positive rate

Warts

None.

Documentation

The latest documentation is always available at docs.rs.

Structs

  • K is the number of keys to insert/hash.
  • M is the number of bits to use in the bloom filter.
  • N is the number of items expected to be inserted into the bloom filter.
  • P is the probability of false positives.

Traits

Functions

  • Given the probability of false positive, compute the necessary number of keys.
  • Given the probability of false positive and number of elements, compute the number of bits.
  • Given the number of elements and number of bits, compute the probability of false positive.