[package]
name = "nimiq-utils"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
description = "Various utilities (e.g., CRC, Merkle proofs, timers) for Nimiq's Rust implementation"
homepage.workspace = true
repository.workspace = true
categories.workspace = true
keywords.workspace = true

[badges]
travis-ci = { repository = "nimiq/core-rs", branch = "master" }
is-it-maintained-issue-resolution = { repository = "nimiq/core-rs" }
is-it-maintained-open-issues = { repository = "nimiq/core-rs" }
maintenance = { status = "experimental" }

[lints]
workspace = true

[dependencies]
clear_on_drop = { version = "0.2", optional = true }
futures = { workspace = true, optional = true }
hex = { version = "0.4", optional = true }
instant = { version = "0.1", features = ["wasm-bindgen"] }
libp2p-identity = { version = "0.2", optional = true }
log = { workspace = true, optional = true }
parking_lot = "0.12"
pin-project = "1.1"
rand = { version = "0.9", optional = true }
rand_core = { version = "0.9", optional = true }
serde = "1.0"
subtle = { version = "2.6", optional = true }
thiserror = { version = "2.0", optional = true }

nimiq-collections = { workspace = true, optional = true }
nimiq-database-value = { workspace = true }
nimiq-database-value-derive = { workspace = true }
nimiq-hash = { workspace = true, optional = true }
nimiq-serde = { workspace = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
tokio = { version = "1.52.1", optional = true }
[target.'cfg(target_family = "wasm")'.dependencies]
wasm-bindgen-futures = { version = "0.4", optional = true }

[features]
crc = []
credentials = ["nimiq-hash", "subtle"]
futures = ["dep:futures"]
key-rng = ["rand", "rand_core"]
key-store = ["log", "thiserror"]
libp2p = ["libp2p-identity"]
merkle = [
    "nimiq-collections",
    "nimiq-hash",
]
otp = ["clear_on_drop", "nimiq-hash", "rand"]
spawn = ["tokio", "tokio/rt", "wasm-bindgen-futures"]
tagged-signing = ["hex"]
time = []
