1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved // // SPDX-License-Identifier: Apache-2.0 use thiserror::Error; /// Error returned when canonical lowercase hex decoding fails. #[derive(Debug, Error, Eq, PartialEq)] pub enum HexError { /// 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, }