bloom-sol

Crates.iobloom-sol
lib.rsbloom-sol
version0.0.3
created_at2025-08-18 14:51:28.486234+00
updated_at2025-08-18 15:15:21.941256+00
descriptionCounting bloom filter, aimed for solana
homepage
repositoryhttps://github.com/ohaddahan/bloom-sol/tree/master
max_upload_size
id1800590
size11,922
(ohaddahan)

documentation

https://docs.rs/bloom-sol/latest

README

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 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:

[dependencies]
bloom-sol = "0.0.1"

License

MIT

Commit count: 0

cargo fmt