# bloom-sol
A Rust implementation of a counting Bloom filter, specifically designed with Solana blockchain development in mind.
## Features
- **Counting Bloom Filter**: Supports insertion, deletion, and membership queries
- **Configurable**: Adjustable size and number of hash functions
- **Boolean Mode**: Optional boolean counting mode for simpler use cases
- **Serialization**: Built-in serialize/deserialize functionality
- **False Positive Estimation**: Calculate estimated false positive rates
- **Solana-Optimized**: Designed for efficient use in Solana programs
## Usage
```rust
use bloom_sol::bloom_sol::struct_def::CountingBloomFilter;
// Create a new counting bloom filter
let mut filter = CountingBloomFilter::new(1000, 4, false);
// Insert an item
filter.insert(&b"hello world");
// Check membership
let contains = filter.contains(&b"hello world"); // true
let not_contains = filter.contains(&b"goodbye"); // false (or possibly true - false positive)
// Remove an item (only in counting mode)
filter.remove(&b"hello world");
```
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
bloom-sol = "0.0.1"
```
## License
MIT