commonware-utils 2026.2.0

Leverage common functionality across multiple primitives.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
name = "commonware-utils"
version = "2026.2.0"
build = false
publish = true
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Leverage common functionality across multiple primitives."
homepage = "https://commonware.xyz"
documentation = "https://docs.rs/commonware-utils"
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/commonwarexyz/monorepo/tree/main/utils"

[features]
arbitrary = [
    "commonware-codec/arbitrary",
    "dep:arbitrary",
    "num-bigint?/arbitrary",
    "std",
]
default = ["std"]
std = [
    "bytes/std",
    "commonware-codec/std",
    "commonware-macros/std",
    "futures",
    "getrandom/std",
    "num-bigint",
    "num-bigint?/std",
    "num-integer",
    "num-rational",
    "num-traits/std",
    "rand/std",
    "rand/std_rng",
    "thiserror/std",
    "tokio",
    "zeroize/std",
]

[lib]
name = "commonware_utils"
crate-type = [
    "rlib",
    "cdylib",
]
path = "src/lib.rs"
bench = false

[[bench]]
name = "utils"
path = "src/benches/bench.rs"
harness = false

[dependencies.arbitrary]
version = "1.4.1"
features = ["derive"]
optional = true

[dependencies.bytes]
version = "1.7.1"
default-features = false

[dependencies.cfg-if]
version = "1.0.0"

[dependencies.commonware-codec]
version = "2026.2.0"
default-features = false

[dependencies.commonware-macros]
version = "2026.2.0"
default-features = false

[dependencies.futures]
version = "0.3.31"
optional = true

[dependencies.hashbrown]
version = "0.16.1"
features = ["default-hasher"]
default-features = false

[dependencies.num-bigint]
version = "0.4.6"
optional = true
default-features = false

[dependencies.num-integer]
version = "0.1.46"
optional = true

[dependencies.num-rational]
version = "0.4.2"
features = ["num-bigint"]
optional = true

[dependencies.num-traits]
version = "0.2.19"
default-features = false

[dependencies.pin-project]
version = "1.1.10"

[dependencies.rand]
version = "0.8.5"
default-features = false

[dependencies.thiserror]
version = "2.0.12"
default-features = false

[dependencies.tokio]
version = "1.43.0"
features = ["sync"]
optional = true

[dependencies.zeroize]
version = "1.5.7"

[dev-dependencies.commonware-conformance]
version = "2026.2.0"

[dev-dependencies.commonware-macros]
version = "2026.2.0"
default-features = false

[dev-dependencies.criterion]
version = "0.7.0"

[dev-dependencies.num-bigint]
version = "0.4.6"
default-features = false

[dev-dependencies.proptest]
version = "1.8.0"

[dev-dependencies.rstest]
version = "0.26.1"

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2.15"
features = ["js"]

[lints.clippy]
disallowed_macros = "deny"
disallowed_types = "deny"
missing-const-for-fn = "warn"
option-if-let-else = "warn"
redundant-clone = "warn"
suspicious_op_assign_impl = "allow"
undocumented_unsafe_blocks = "deny"
use-self = "warn"

[lints.rust]
rust-2018-idioms = "deny"
unused-must-use = "deny"
warnings = "deny"

[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = [
    "cfg(full_bench)",
    "cfg(generate_conformance_tests)",
    "cfg(commonware_stability_BETA)",
    "cfg(commonware_stability_GAMMA)",
    "cfg(commonware_stability_DELTA)",
    "cfg(commonware_stability_EPSILON)",
    "cfg(commonware_stability_RESERVED)",
]