Bloom Filter
Simple bloom filter implementation in Rust.
To use this crate in any Rust project just one of the following dependencies.
Install
[dependencies]
...
bfilters = { git = "https://github.com/alexanderbakhmach/bloom-filter", branch = "<desired-branch>", version = "<desired-version>"}
For example for dev branch with version 0.1.1 the dependecy will look the following.
[dependencies]
...
bfilters = { git = "https://github.com/alexanderbakhmach/bloom-filter", branch = "dev", version = "0.1.1"}
Use
The example below illustrates the bloom filter usage.
use BloomFilter;
...
let items_capacity: u32 = 933_333;
let false_positive_probability: f32 = 0.04;
let mut bloom_filter: BloomFilter =
match new ;
let item_to_save: &str = "Erc20Token";
let item_absent: &str = "Erc721Token";
bloom_filter.insert;
assert!;
Docs
Rust provides you with a beautiful documentation autogeneration tool. To generate documentation in your browser simply run the following command from the root of this project.