#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

#1020 in Rust patterns

Download history 890/week @ 2024-01-03 660/week @ 2024-01-10 555/week @ 2024-01-17 893/week @ 2024-01-24 1075/week @ 2024-01-31 1016/week @ 2024-02-07 1182/week @ 2024-02-14 1044/week @ 2024-02-21 862/week @ 2024-02-28 691/week @ 2024-03-06 653/week @ 2024-03-13 644/week @ 2024-03-20 528/week @ 2024-03-27 630/week @ 2024-04-03 720/week @ 2024-04-10 354/week @ 2024-04-17

2,357 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