https://github.com/michael2012z/bitruler
A command-line utility for visualizing, decoding, and inspecting binary data and bit fields.
https://github.com/michael2012z/bitruler
Last synced: about 1 month ago
JSON representation
A command-line utility for visualizing, decoding, and inspecting binary data and bit fields.
- Host: GitHub
- URL: https://github.com/michael2012z/bitruler
- Owner: michael2012z
- License: mit
- Created: 2026-05-11T14:10:51.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-11T19:56:50.000Z (about 1 month ago)
- Last Synced: 2026-05-11T20:31:04.901Z (about 1 month ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitruler
`bitruler` is a command-line utility for visualizing, decoding, and inspecting
data as bits, hexadecimal digits, and common numeric formats.
It prints a compact bit ruler that makes it easier to see where each nibble and
bit position sits inside a value.
## Features
- Accepts unsigned integers up to `u128`.
- Supports hexadecimal, decimal, octal, and binary input.
- Allows underscores as digit separators.
- Shows a visual unit ruler, hexadecimal digit art, bit groups, and bit positions.
- Prints decoded `HEX`, `DEC`, `OCT`, `BIN`, and printable ASCII information.
## Installation
```sh
cargo install bitruler
```
## Usage
Example command:
```sh
bitruler 0x1234_5678_9abc
```
Output:
```text
U 16M ─┐ ┌─ 1M
N 256M ─┐ │ │ ┌─ 64K
I 4G ─┐ │ │ │ │ ┌─ 4K
T 64G ─┐ │ │ │ │ │ │ ┌─ 256
1T ─┐ │ │ │ │ │ │ │ │ ┌─ 16
16T ┐ │ │ │ │ │ │ │ │ │ │ ┌─ 1
H █ ████ ████ █ █ ████ ████ ████ ████ ████ ████ ███ ████
E ██ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
X █ ████ ████ ████ ████ ████ █ ████ ████ ████ ███ █
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
███ ████ ████ █ ████ ████ █ ████ ████ █ █ ███ ████
├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤ ├┬┬┤
B
I 0001_0010_0011_0100 _ 0101_0110_0111_1000 _ 1001_1010_1011_1100
T
└──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤ └──┤
P │ │ │ │ │ │ │ │ │ │ │ │
O │ │ │ │ │ │ │ │ │ │ │ │
S 44 40 36 32 28 24 20 16 12 8 4 0
HEX: 0x1234_5678_9abc
DEC: 20015998343868
OCT: 0o443212636115274
BIN: 0b0001_0010_0011_0100_0101_0110_0111_1000_1001_1010_1011_1100
ASC: .4Vx..
```
## License
This project is licensed under the MIT License. See `LICENSE` for details.