Skip to main content

Module hex

Module hex 

Source
Expand description

Hexadecimal encoding and decoding with streaming support.

Provides upper/lowercase hex codecs with chunked encoding, streaming decoders, and utilities for formatting and parsing hex strings.

Re-exports§

pub use super::Array;
pub use super::ArrayStr;
pub use super::DecodeError;
pub use super::Result;

Structs§

Decoder
A streaming hex decoder that converts hex characters to bytes.
Encoder
Iterator that encodes bytes as individual hex ASCII characters.

Enums§

Encoding
Character set for hex encoding (uppercase or lowercase).

Constants§

LOWER
Lowercase hex digits (a-f)
STD
Standard hex encoding.
UPPER
Uppercase hex digits (A-F)

Functions§

decode
Decodes a hex string into a vector of bytes.
decode_len
Returns the decoded length for a given hex string length.
decode_mut
Decodes a hex string in-place, writing to a destination buffer.
decode_n
Decodes hex at compile time with validation.
encode
Encodes bytes to lowercase hex, returning an Encoder.
encode_len
Returns the exact encoded length for a given source byte length.
encode_mut
Encodes bytes to lowercase hex into a flat byte buffer.
encode_n
Encodes bytes to lowercase hex at compile time.
parse_byte
Parses two hex characters into a byte.
parse_nibble
Safely parses a hex character into a nibble (0-15).
skip_0x
Skips the 0x or 0X prefix from a byte slice if present.
skip_leading_zeros
Skips leading zero characters from a byte slice.

Type Aliases§

CharEncoder
Iterator that encodes bytes as hex characters (char type).