A colored hex viewer — what xxd and hexdump -C should feel like on a modern terminal.
00000000 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a 00 01 |Hello, world!...|
Printable ASCII is green, control characters are yellow, nulls are dim, and high bytes (≥ 0x80) are cyan. The address column is dimmed. If stdout is not a terminal — or NO_COLOR is set, or you pass --no-color — output is plain so you can pipe it anywhere.
hexview <file>orhexview -for stdin--width Nbytes per line (default 16)--skip N/-s N,--length N/-n N--group Nextra space every N bytes (default 8)--format hex|dec|bin— byte values as hex, padded decimal, or raw binary--no-color,--no-ascii,--no-address--diff FILE1 FILE2— side-by-side byte diff with mismatches highlighted- Zero dependencies beyond
clap(color is hand-rolled ANSI) - Honors
NO_COLORand auto-detects tty viastd::io::IsTerminal
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Read error / I/O failure |
| 2 | Bad arguments |
cargo build --release
./target/release/hexview --helpdocker build -t hexview .
docker run --rm -v "$PWD":/work hexview myfile.bin
docker run --rm -v "$PWD":/work hexview --diff a.bin b.bincargo test17 integration tests plus unit tests for the dump, color, and diff modules.
MIT — see LICENSE.