Thanks to visit codestin.com
Credit goes to lib.rs

#hex-dump #binary #ascii #hex

bin+lib hexetta

Flexible CLI tool for printing files and data in multiple bases

1 unstable release

Uses new Rust 2024

0.6.5 Jan 28, 2026

#2786 in Encoding

GPL-3.0-only

26KB
546 lines

hexetta

hexetta is a flexible, modern command-line utility for viewing files in multiple bases, such as binary, hexadecimal, and ascii.

It's more customizable and powerful than hexdump and xxd, with features like:

  • Colored output
  • Custom bases with custom alphabets
  • Extremely customizable output
  • A customizable position indicator

Installation

Install via Cargo:

cargo install hexetta

Or build from source:

git clone https://codeberg.org/RevlSoftware/hexetta
cd hexetta
cargo build --release

Usage

Usage: hexetta [OPTIONS] [FILES]...

Arguments:
  [FILES]...  Input files; with no FILE, or when FILE is -, read standard input

Options:
  -c, --columns <COLUMNS>
          Amount of bytes per base [default: 16]
  -l, --layout <LAYOUT>
          LAYOUT is a sequence of bases
          A base is a number followed by any character (a backslash to use the default alphabet), and then that number of letters
          Or one of the pre-defined base below
              - b        binary
              - q        quaternary
              - o        octal
              - d        decimal
              - h        hex
              - a        ascii
           [default: ha]
  -p, --position-indicator...
          Toggle position indicator
  -t, --trailing-posind...
          Toggle trailing position indicator
  -B, --byte-delimiter <BYTE_DELIMITER>
          Print BYTE_DELIMITER between each byte [default: " "]
  -A, --ascii-byte-delimiter <ASCII_BYTE_DELIMITER>
          Print BYTE_DELIMITER between each byte in the ascii base [default: ""]
  -S, --base-delimiter <BASE_DELIMITER>
          Print base_DELIMITER between each base [default: "    "]
  -P, --posind-delimiter <POSIND_DELIMITER>
          Print POSIND_DELIMIITER between position indicator and first base column [default: "  "]
  -L, --line-delimiter <LINE_DELIMITER>
          Print LINE_DELIMITER between each line [default: "\n"]
  -F, --file-delimiter <FILE_DELIMITER>
          Print FILE_DELIMITER between each file [default: "\n"]
  -m, --merge-files...
          Toggle whether to merge all files into one file, ignoring FILE_DELIMITER
  -u, --unprintable-char <CHAR>
          Print CHAR when an unprintable ascii char is found [default: .]
  -C, --color <COLOR>
          Color the output
          COLOR is:
                  - 'true', 'on' or '1' to turn coloring on
                  - 'ascii' to turn coloring on only for ascii
                  - 'false', 'off', or '0' to turn coloring off
           [default: false]
  -b, --bold...
          Toggle boldness
  -h, --help
          Print help
  -V, --version
          Print version

Examples

Dump file

hexetta file

Dump 3 files

hexetta file1 file2 file3

Dump file with 8 columns per base (instead of 16)

hexetta -c 8 file

Dump file with decimal and ascii layout

hexetta -l da file

Dump file with colored and bolded output

hexetta -C on -b file

Dependencies

~0.8–1.4MB
~25K SLoC