bloom-lib 1.0.0

Probabilistic data structure library: Bloom filters, Cuckoo filters, Count-Min Sketch, HyperLogLog, MinHash, and Top-K. Tunable false-positive rates, serializable state, merge support, and streaming-safe updates.
Documentation
[package]
name = "bloom-lib"
version = "1.0.0"
edition = "2021"
rust-version = "1.75"
readme = "README.md"
license = "Apache-2.0 OR MIT"

authors = [
    "James Gober <me@jamesgober.com>"
]

description = "Probabilistic data structure library: Bloom filters, Cuckoo filters, Count-Min Sketch, HyperLogLog, MinHash, and Top-K. Tunable false-positive rates, serializable state, merge support, and streaming-safe updates."

keywords = [
    "bloom",
    "probabilistic",
    "hyperloglog",
    "filter",
    "rust"
]

categories = [
    "data-structures",
    "algorithms"
]

documentation = "https://docs.rs/bloom-lib"
repository    = "https://github.com/jamesgober/bloom-lib"
homepage      = "https://github.com/jamesgober/bloom-lib"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "bloom_lib"
path = "src/lib.rs"

[features]
default = ["std"]
# `std` pulls in `alloc` and adds the `std::error::Error` implementation.
std = ["alloc"]
# `alloc` enables every data structure. Without it the crate exposes only
# `VERSION` and `Error`, so embedded targets can still link the crate.
alloc = []
# `serde` derives `Serialize`/`Deserialize` for every structure (requires `alloc`).
serde = ["dep:serde", "alloc"]

[dependencies]
# Pure-Rust libm: supplies transcendental math (`ln`, `exp`, `sqrt`, …) on
# `no_std` targets and guarantees bit-identical sizing results across every
# platform, so a filter built on one OS is byte-compatible on another.
libm = { version = "0.2", default-features = false }
# Optional. Serialization of structure state. Off by default; `alloc`-only.
serde = { version = "1.0", optional = true, default-features = false, features = ["derive", "alloc"] }

[dev-dependencies]
# JSON codec used to exercise the optional `serde` round-trips in tests.
serde_json = "1.0"
# Property-based tests for the structures' probabilistic invariants.
proptest = "1"
# Microbenchmarks for the insert/query hot paths. Default features are disabled
# to keep the dev-dependency tree (and the MSRV surface) small.
criterion = { version = "0.5", default-features = false, features = ["cargo_bench_support"] }

# The committed `Cargo.lock` pins this dev-dependency tree to versions that still
# build on the MSRV (Rust 1.75). Newer releases of these crates require a newer
# compiler; they are dev-only and never reach published consumers. Re-pin with
# `cargo update -p <crate> --precise <ver>` if you bump the MSRV.

[[bench]]
name = "probabilistic"
harness = false
required-features = ["std"]

# Examples print results, so they need `std`; declaring the requirement lets
# `cargo build --no-default-features` skip them instead of failing to resolve.
[[example]]
name = "bloom_dedup"
required-features = ["std"]

[[example]]
name = "membership_with_deletion"
required-features = ["std"]

[[example]]
name = "frequency"
required-features = ["std"]

[[example]]
name = "cardinality"
required-features = ["std"]

[[example]]
name = "similarity"
required-features = ["std"]

[[example]]
name = "top_words"
required-features = ["std"]

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols"

[profile.bench]
opt-level = 3
lto = "fat"
codegen-units = 1
debug = true