#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

#2906 in Rust patterns

Download history 3649/week @ 2023-12-18 615/week @ 2023-12-25 2115/week @ 2024-01-01 3722/week @ 2024-01-08 2787/week @ 2024-01-15 3214/week @ 2024-01-22 3033/week @ 2024-01-29 2158/week @ 2024-02-05 3595/week @ 2024-02-12 2686/week @ 2024-02-19 3064/week @ 2024-02-26 2440/week @ 2024-03-04 1775/week @ 2024-03-11 2223/week @ 2024-03-18 2068/week @ 2024-03-25 2220/week @ 2024-04-01

8,310 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