#hex #hexdump

hxdmp

A small utility to create hexdump output from byte slices

2 unstable releases

0.2.1 Dec 7, 2021
0.2.0 Dec 7, 2021
0.1.0 Mar 6, 2020

#8 in #hexdump

Download history 973/week @ 2022-12-05 1192/week @ 2022-12-12 632/week @ 2022-12-19 405/week @ 2022-12-26 856/week @ 2023-01-02 891/week @ 2023-01-09 556/week @ 2023-01-16 907/week @ 2023-01-23 791/week @ 2023-01-30 950/week @ 2023-02-06 946/week @ 2023-02-13 830/week @ 2023-02-20 695/week @ 2023-02-27 689/week @ 2023-03-06 994/week @ 2023-03-13 662/week @ 2023-03-20

3,084 downloads per month
Used in 3 crates

MIT/Apache

28KB
413 lines

hxdmp

Generate a hexdump from a byte slice onto a given writer

Usage

let some_bytes = b"Hello, World! I'm hexy";
let mut buffer = Vec::new();
assert!(hexdump(some_bytes, &mut buffer).is_ok());
assert_eq!(
    r#"0000: 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 20 49 27  Hello,.World!.I'
0016: 6D 20 68 65 78 79                                m.hexy"#,
    String::from_utf8_lossy(&buffer)
);

Example Output

0000: 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 20 49 27  Hello,.World!.I'
0016: 6D 20 68 65 78 79                                m.hexy

lib.rs:

hxdmp

A small utility to create hexdump output from byte slices on the given writer.

Example

# use hxdmp::hexdump;
# use std::io::Result;
#
# fn main() -> Result<()> {
    let some_bytes = b"Hello, World! I'm hexy";
    let mut buffer = Vec::new();
    assert!(hexdump(some_bytes, &mut buffer).is_ok());
    assert_eq!(
        r#"0000: 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 20 49 27  Hello,.World!.I'
0016: 6D 20 68 65 78 79                                m.hexy"#,
        String::from_utf8_lossy(&buffer)
    );
#     Ok(())
# }

No runtime deps