<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**
[](https://crates.io/crates/bloom-bitset)
[](https://docs.rs/bloom-bitset)
[](https://github.com/crates-dev/ctares/actions/workflows/rust.yml)
[](https://www.rust-lang.org)
[](../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).