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
use CountingBloomFilter;
// Create a new counting bloom filter
let mut filter = new;
// Insert an item
filter.insert;
// Check membership
let contains = filter.contains; // true
let not_contains = filter.contains; // false (or possibly true - false positive)
// Remove an item (only in counting mode)
filter.remove;
Installation
Add this to your Cargo.toml:
[]
= "0.0.1"
License
MIT