#byte-slice #hex-dump #hex #writer #generate #onto #io

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

#1701 in Rust patterns

Download history 2342/week @ 2024-11-20 2855/week @ 2024-11-27 2459/week @ 2024-12-04 2187/week @ 2024-12-11 1977/week @ 2024-12-18 756/week @ 2024-12-25 1550/week @ 2025-01-01 2413/week @ 2025-01-08 1903/week @ 2025-01-15 1324/week @ 2025-01-22 1838/week @ 2025-01-29 2137/week @ 2025-02-05 2282/week @ 2025-02-12 2665/week @ 2025-02-19 1733/week @ 2025-02-26 1916/week @ 2025-03-05

8,948 downloads per month
Used in 11 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