Skip to main content

format_hex_row

Function format_hex_row 

Source
pub fn format_hex_row(offset: usize, bytes: &[u8]) -> String
Expand description

Format one row of a hex dump.

Layout: <8-hex-digit offset>: <16 bytes as 8 x 2-byte words> <16-char ASCII gutter>. When bytes.len() < 16, the hex portion is right-padded with spaces so the ASCII gutter remains column-aligned with full rows.

Offsets larger than 0xFFFFFFFF still render with at least 8 hex digits (the format width is a minimum, not a max).

Non-printable bytes (outside 0x20..=0x7E) render as . in the ASCII gutter.