#hex #hexdump #byte #print #color

hexy

A rust library for printing hexy hex dumps with colors based on the byte values

5 releases

0.1.4 Sep 7, 2022
0.1.3 Sep 7, 2022
0.1.2 Feb 7, 2021
0.1.1 Feb 7, 2021
0.1.0 Feb 7, 2021

#5 in #hexdump

Download history 1/week @ 2022-06-09 1/week @ 2022-06-16 5/week @ 2022-06-23 8/week @ 2022-07-07 9/week @ 2022-07-14 9/week @ 2022-07-21 9/week @ 2022-07-28 4/week @ 2022-08-04 2/week @ 2022-08-11 1/week @ 2022-08-18 8/week @ 2022-08-25 25/week @ 2022-09-01 43/week @ 2022-09-08 12/week @ 2022-09-15 9/week @ 2022-09-22

89 downloads per month

GPL-3.0-only

5KB
86 lines

hexy

This is a simple utility that can print a byte as an ASCII char or hex value. It will change the color of the byte based on the byte value.
This can be used with some builtin functions to provide a hexdump-like interface, or for byte-by-byte hex value or ASCII character printing.

Usage as a library

[dependencies]
hexy = "0.1.2"

API

//! This reads in 512 byte chunks and prints as a colorful hexdump
//! input: Must implement the Read trait
pub fn hexyfile<T: std::io::Read>(mut input: T) -> usize

//! This prints the colorful hexdump
//! a: byte slice
//! length: label for left column
//! piece: size of chunk
pub fn hexydump(a: &[u8], length: &usize, piece: &usize)

//! This prints a single u8 as a colorful char, if possible, else a '.'
pub fn hexy_c(a: &u8)

//! This prints a single u8 as a colorful hex byte {:02x}
pub fn hexy_x(a: &u8)

Dependencies

~92KB