bloom-bitset 11.2.0

Zero-dependency probabilistic data structures: 512-bit cache-line-blocked Bloom filter, 4-bit saturating Counting Bloom filter, and HyperLogLog cardinality estimator.
Documentation
<div align="center">

<img src="https://devhub.vip/pages/docs/img/logo.png" alt="bloom-bitset logo" height="120">

# bloom-bitset

**Zero-Dependency Cache-Line-Blocked Bloom Filter, Counting Bloom Filter & HyperLogLog**

[![Crates.io Version](https://flat.badgen.net/crates/v/bloom-bitset)](https://crates.io/crates/bloom-bitset)
[![Docs.rs](https://img.shields.io/docsrs/bloom-bitset?style=flat-square)](https://docs.rs/bloom-bitset)
[![CI Status](https://img.shields.io/github/actions/workflow/status/crates-dev/ctares/rust.yml?branch=master&style=flat-square&label=CI)](https://github.com/crates-dev/ctares/actions/workflows/rust.yml)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../LICENSE)

[Workspace Overview](../README.md) ยท [API Docs](https://docs.rs/bloom-bitset/latest/)

</div>

---

## Overview

`bloom-bitset` provides zero-dependency probabilistic data structures for high-throughput membership and cardinality queries: `BlockedBloomFilter`, `CountingBloomFilter`, and `HyperLogLog`.

## Installation

```sh
cargo add bloom-bitset
```

## Usage

```rust
use bloom_bitset::{BlockedBloomFilter, CountingBloomFilter, HyperLogLog};

let mut bloom = BlockedBloomFilter::with_rate(10_000, 0.01);
bloom.insert(b"session:42");
assert!(bloom.contains(b"session:42"));

let mut counting = CountingBloomFilter::with_rate(10_000, 0.01);
counting.insert(b"key-1");
assert!(counting.remove(b"key-1"));

let mut hll = HyperLogLog::new(12);
hll.insert(b"visitor-1");
assert!(hll.estimate() >= 1.0);
```

## Verification

```sh
cargo run -p crate-cli -- fmt --check
cargo clippy -p bloom-bitset --all-features --all-targets -- -D warnings
cargo test -p bloom-bitset --all-features
```

## License

This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.

## Contact

For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).