#hex-dump #byte-slice #hex #hello-world

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

#1019 in Rust patterns

Download history 712/week @ 2023-12-05 683/week @ 2023-12-12 413/week @ 2023-12-19 301/week @ 2023-12-26 886/week @ 2024-01-02 726/week @ 2024-01-09 525/week @ 2024-01-16 838/week @ 2024-01-23 980/week @ 2024-01-30 1123/week @ 2024-02-06 1043/week @ 2024-02-13 1219/week @ 2024-02-20 900/week @ 2024-02-27 670/week @ 2024-03-05 684/week @ 2024-03-12 596/week @ 2024-03-19

3,049 downloads per month
Used in 8 crates (6 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