[package] name = "commonware-utils" edition.workspace = true publish = true version.workspace = true license.workspace = true description = "Leverage common functionality across multiple primitives." readme = "README.md" homepage.workspace = true repository = "https://github.com/commonwarexyz/monorepo/tree/main/utils" documentation = "https://docs.rs/commonware-utils" [lints] workspace = true [dependencies] arbitrary = { workspace = true, optional = true, features = ["derive"] } bytes.workspace = true cfg-if.workspace = true commonware-codec = { workspace = true, default-features = false } commonware-formatting = { workspace = true, default-features = false } commonware-macros.workspace = true futures = { workspace = true, optional = true } hashbrown.workspace = true num-bigint = { workspace = true, optional = true } num-integer = { workspace = true, optional = true } num-rational = { workspace = true, optional = true } num-traits.workspace = true parking_lot = { workspace = true, optional = true } pin-project.workspace = true rand.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["sync"], optional = true } zeroize.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies.getrandom] # Enable "js" feature when WASM is target version = "0.2.15" features = ["js"] [dev-dependencies] arbitrary = { workspace = true, features = ["derive"] } commonware-conformance.workspace = true commonware-invariants.workspace = true commonware-macros.workspace = true criterion.workspace = true num-bigint = { workspace = true, default-features = false } proptest.workspace = true roaring = "0.10.12" rstest.workspace = true [features] default = [ "std" ] std = [ "bytes/std", "commonware-codec/std", "commonware-formatting/std", "commonware-macros/std", "futures", "getrandom/std", "num-bigint", "num-bigint?/std", "num-integer", "num-rational", "num-traits/std", "parking_lot", "rand/std", "rand/std_rng", "thiserror/std", "tokio", "zeroize/std", ] arbitrary = [ "commonware-codec/arbitrary", "dep:arbitrary", "num-bigint?/arbitrary", "std", ] # Enables analytical helpers used by roaring analysis benchmarks. # Off by default; tests turn it on automatically via `cfg(test)`. analysis = [] # Exposes the `pub mod fuzz` Plan + run harness used by both `cargo fuzz` and the # in-test `minifuzz`-driven property test. Off by default. Tests pick it up via the # `arbitrary` dev-dependency path; the `cargo-fuzz` target opts in via `--features fuzz`. fuzz = [ "arbitrary", "arbitrary/derive", "dep:arbitrary", "std" ] [lib] bench = false [[bench]] name = "bitmap" harness = false path = "src/bitmap/benches/bench.rs" [[bench]] name = "roaring_memory" harness = false path = "src/bitmap/benches/roaring_memory.rs" required-features = ["analysis"] [[bench]] name = "rational" harness = false path = "src/rational/benches/bench.rs"