#byte-slice #hex-dump #hex

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

#1122 in Rust patterns

Download history 1057/week @ 2024-07-22 625/week @ 2024-07-29 780/week @ 2024-08-05 675/week @ 2024-08-12 785/week @ 2024-08-19 747/week @ 2024-08-26 879/week @ 2024-09-02 751/week @ 2024-09-09 627/week @ 2024-09-16 826/week @ 2024-09-23 946/week @ 2024-09-30 1102/week @ 2024-10-07 1048/week @ 2024-10-14 2728/week @ 2024-10-21 2818/week @ 2024-10-28 2248/week @ 2024-11-04

8,946 downloads per month
Used in 10 crates (7 directly)

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

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

No runtime deps