Skip to content

JarredAllen/hex-display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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"
);

About

Rust display impl for byte slices which provides a hexdump

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages