Crates.io | zeen_filter |
lib.rs | zeen_filter |
version | 0.1.0 |
source | src |
created_at | 2024-09-05 04:22:16.279734 |
updated_at | 2024-09-05 04:22:16.279734 |
description | A fast and optimized Bloom Filter implementation in Rust. |
homepage | https://github.com/nzengi |
repository | https://github.com/nzengi/zeen_filter |
max_upload_size | |
id | 1364177 |
size | 37,890 |
Zeen Filter is a highly optimized Bloom filter implementation designed for high-performance applications. It provides a memory-efficient, scalable solution for large datasets while minimizing false positives.
rayon
to handle large datasets efficiently.Add Zeen Filter to your Cargo.toml
file:
[dependencies]
zeen_filter = "0.1.0"
use zeen_filter::filters::bloom_filter::BloomFilter;
use zeen_filter::utils::logging::log_insertion;
fn main() {
// Create a Bloom Filter for 10,000 expected items with a 1% false positive rate
let mut filter = BloomFilter::new(10_000, 0.01);
// Insert data into the filter
filter.insert("Blockchain");
log_insertion("Blockchain");
// Check if data is in the filter
if filter.contains("Blockchain") {
println!("Blockchain might be in the filter");
}
if !filter.contains("Ethereum") {
println!("Ethereum is definitely not in the filter");
}
}
carga bench