Skip to content

sen-ltd/hexview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexview

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.

Features

  • hexview <file> or hexview - for stdin
  • --width N bytes per line (default 16)
  • --skip N / -s N, --length N / -n N
  • --group N extra 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_COLOR and auto-detects tty via std::io::IsTerminal

Exit codes

Code Meaning
0 Success
1 Read error / I/O failure
2 Bad arguments

Build

cargo build --release
./target/release/hexview --help

Docker

docker build -t hexview .
docker run --rm -v "$PWD":/work hexview myfile.bin
docker run --rm -v "$PWD":/work hexview --diff a.bin b.bin

Test

cargo test

17 integration tests plus unit tests for the dump, color, and diff modules.

License

MIT — see LICENSE.

Links

About

A colored hex viewer built as a rethink of xxd and hexdump -C for day-to-day debugging, shipped as a small Rust CLI with exactly one real dependency (clap).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors