4 releases

Uses new Rust 2024

0.2.2 May 13, 2025
0.2.1 May 13, 2025
0.2.0 May 13, 2025
0.1.0 May 13, 2025

#861 in Text processing


Used in xxr

MIT license

510KB
401 lines

Colored-Hexdump

Create beautifuly colored hexdump in Rust.

Add to your project

cargo add colored-hexdump

Hexdump

colored_hexdump::hexdump()

Use colored_hexdump::hexdump() to create an hexdump with borders.

use colored_hexdump::hexdump;

fn main() {
    // All possible bytes
    let all_bytes: Vec<u8> = (0..=u8::MAX).collect();

    // Create hexdump, and print it to stdout
    let hexdump = hexdump(&all_bytes);
    println!("{}", hexdump);
}

xxd

You can also go with a more classic xxd style with colored_hexdump::xxd().

colored_hexdump::xxd()

use colored_hexdump::xxd;

fn main() {
    // All possible bytes
    let all_bytes: Vec<u8> = (0..=u8::MAX).collect();

    // Create hexdump, and print it to stdout
    let hexdump = xxd(&all_bytes);
    println!("{}", hexdump);
}

No runtime deps