bloom-sol 0.0.2

Counting bloom filter, aimed for solana
Documentation
  • Coverage
  • 33.33%
    9 out of 27 items documented0 out of 9 items with examples
  • Size
  • Source code size: 11.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.82 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ohaddahan

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