/buildx_pdsa

BuildX PDSA - A build_x project on Probabilistic Data Structures in Rust

Primary LanguageRustApache License 2.0Apache-2.0

BuildX PDSA: A build_x project on Probabilistic Data Structures in Rust

BuildX PDSA is a collection of probabilistic data structures implemented in Rust. These data structures are useful for various applications where approximate answers or approximations to subsets are sufficient.

Build License:MIT Coverage Status

Installation

Add the following line to your Cargo.toml file:

[dependencies]
buildx_pdsa = "0.1.0"

Usage

BloomFilter

use buildx_pdsa::membership::bloom_filter::BloomFilter;

fn main() {
    // Create a Bloom filter with 1000 items and a false positive rate of 1%
    let mut bloom_filter = BloomFilter::new(1000, 0.01).unwrap();

    // Insert some items into the Bloom filter
    bloom_filter.insert(&"foo");
    bloom_filter.insert(&"bar");

    // Check if an item is in the Bloom filter
    assert!(bloom_filter.contains(&"foo"));
    assert!(!bloom_filter.contains(&"baz"));
}

Contribution

Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository. If you would like to contribute code, please fork the repository and submit a pull request.

See CONTRIBUTING.md.

License

BuildX PDSA is licensed under the MIT license. See the LICENSE file for details.