#hex #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

#389 in No standard library

Download history 4698/week @ 2023-08-18 5370/week @ 2023-08-25 4361/week @ 2023-09-01 4325/week @ 2023-09-08 5358/week @ 2023-09-15 4555/week @ 2023-09-22 5017/week @ 2023-09-29 6912/week @ 2023-10-06 6510/week @ 2023-10-13 7949/week @ 2023-10-20 8170/week @ 2023-10-27 6063/week @ 2023-11-03 4516/week @ 2023-11-10 3391/week @ 2023-11-17 2808/week @ 2023-11-24 4037/week @ 2023-12-01

15,766 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