hey-base32
A fast, zero-dependency base32 encoder/decoder for the command line (RFC 4648).
No library API, no dependencies — just a clean CLI that pipes, reads files, and round-trips binary data.
Install
npm install -g hey-base32
Or run it once without installing:
npx hey-base32 encode "hello world"
Usage
hey-base32 <command> [input] [options]
Commands
encode | e | encode input to base32 |
decode | d | decode base32 input back to bytes |
Input
- Pass text directly:
hey-base32 encode "hello"
- Read a file:
-f, --file PATH (use - for stdin)
- With no argument and no
--file, stdin is read.
Options
-o, --output PATH | write result to a file instead of stdout |
--hex | use the RFC 4648 extended-hex alphabet |
--no-pad | omit = padding when encoding |
--lower | lowercase the encoded output |
-w, --wrap N | wrap encoded output every N characters (0 = no wrap) |
-n, --no-newline | do not print a trailing newline |
-h, --help | show help |
-v, --version | show version |
Examples
hey-base32 encode "hello world"
echo -n "hello" | hey-base32 e
hey-base32 decode NBSWY3DP
hey-base32 e -f photo.png -o photo.b32 --wrap 76
hey-base32 d -f photo.b32 -o photo-restored.png
hey-base32 encode "hello" --hex --no-pad
Decoding tolerates whitespace, lowercase input, and missing padding.
License
MIT © Yaz Caleb