#hex #slice #byte-slice

no-std hex-display

Display impl for byte slices which provides a hexdump

3 unstable releases

0.3.0 Feb 1, 2023
0.2.0 Feb 1, 2023
0.1.1 Nov 9, 2022
0.1.0 Oct 24, 2022

#2923 in Rust patterns

Download history 2624/week @ 2024-03-29 1625/week @ 2024-04-05 1434/week @ 2024-04-12 2419/week @ 2024-04-19 2024/week @ 2024-04-26 1746/week @ 2024-05-03 1162/week @ 2024-05-10 1763/week @ 2024-05-17 1586/week @ 2024-05-24 1625/week @ 2024-05-31 1644/week @ 2024-06-07 1792/week @ 2024-06-14 1965/week @ 2024-06-21 1599/week @ 2024-06-28 10438/week @ 2024-07-05 7356/week @ 2024-07-12

21,628 downloads per month

MIT/Apache

6KB
83 lines

hex-display

crates.io

An implementation of Display on a wrapper for &[u8] which provides a hexdump (see [Hex] and HexDisplayExt). This crate also works in no_std environments.

If std is present, it can also convert to a hexdump as a string.

Example usage

use hex_display::HexDisplayExt;

assert_eq!(
    format!("{}", [0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef].hex()),
    "0123456789abcdef"
);
#[cfg(feature = "std")]
assert_eq!(
    [0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef].hex_string(),
    "0123456789abcdef"
);

No runtime deps

Features