#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

#2827 in Rust patterns

Download history 4418/week @ 2024-11-15 2894/week @ 2024-11-22 6977/week @ 2024-11-29 3883/week @ 2024-12-06 4713/week @ 2024-12-13 3095/week @ 2024-12-20 7362/week @ 2024-12-27 8105/week @ 2025-01-03 6621/week @ 2025-01-10 5528/week @ 2025-01-17 12698/week @ 2025-01-24 8884/week @ 2025-01-31 12561/week @ 2025-02-07 10573/week @ 2025-02-14 9610/week @ 2025-02-21 13991/week @ 2025-02-28

48,585 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