reallyme-codec-hex 0.3.1

Canonical lowercase hexadecimal encoding for ReallyMe Codec.
Documentation
// SPDX-FileCopyrightText: 2026 ReallyMe LLC
//
// SPDX-License-Identifier: MIT OR Apache-2.0

use thiserror::Error;

/// Error returned when canonical lowercase hex decoding fails.
#[derive(Debug, Error, Eq, PartialEq)]
#[non_exhaustive]
pub enum HexError {
    /// The output buffer cannot hold the requested hexadecimal text.
    #[error("hex output capacity exceeded")]
    OutputCapacityExceeded,

    /// Hex input must contain two lowercase hexadecimal characters per byte.
    #[error("odd-length hex input")]
    OddLength,

    /// The decoder accepts only canonical lowercase hex.
    #[error("uppercase hex input")]
    Uppercase,

    /// The input contained a byte outside `0-9` or `a-f`.
    #[error("invalid hex input")]
    InvalidCharacter,
}