reallyme-codec-cbor 0.1.1

Canonical CBOR codec support for ReallyMe Crypto.
Documentation
// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
//
// SPDX-License-Identifier: Apache-2.0

//! Deterministic DAG-CBOR codec for authoritative, cryptographically
//! signed data.
//!
//! The decoder is strict by construction: it rejects non-canonical
//! integers, indefinite-length items, floats, tags, out-of-order map keys,
//! and trailing bytes, so a given value has exactly one accepted encoding.
//! Decoding untrusted input is bounded in both memory and stack depth —
//! container length prefixes are checked against the remaining input
//! before any allocation, and nesting is capped at
//! [`MAX_NESTING_DEPTH`] — so neither a crafted length nor pathological
//! nesting can drive an out-of-memory or stack-overflow abort.

mod cid;
mod decode_dag_cbor;
mod encode_dag_cbor;
mod error;
mod value;

/// Maximum array/map nesting depth accepted by [`decode_dag_cbor`].
///
/// Authoritative documents in this system are shallow; this bound is far
/// above any legitimate structure while still stopping a hostile input
/// from recursing the decoder into a stack overflow.
pub const MAX_NESTING_DEPTH: usize = 128;

pub use cid::{
    compute_cid_dag_cbor, dag_cbor_multihash, is_valid_cid_string, sha2_256_content_hash,
    try_parse_cid, verify_dag_cbor_cid, ContentHash, DagCborMultihash, DAG_CBOR_CODEC,
};
pub use decode_dag_cbor::decode_dag_cbor;
pub use encode_dag_cbor::encode_dag_cbor;
pub use error::CborError;
pub use value::CborValue;