#base64 #base32 #ascii #convert #command-line-tool #encoding #data

app trrs

A simple command line tool to convert between common encodings

4 releases (2 breaking)

0.3.0 Apr 5, 2022
0.2.1 Apr 4, 2022
0.2.0 Apr 4, 2022
0.1.0 Apr 1, 2022

#35 in #base32

Unlicense OR MIT OR Apache-2.0 and LGPL-3.0-or-later

26KB
593 lines

trrs

A CLI tool to transform data between different encodings.

Installation

cargo install trrs

Usage

See trrs --help for all options (as well as shorthand variants).

Some examples:

# Reading from STDIN and printing to STDOUT
echo -n ALLYOURBASEAREBELONGTOUS                 | trrs --in-type ascii  --out-type base32
# IFGEYWKPKVJEEQKTIVAVERKCIVGE6TSHKRHVKUY=
echo -n IFGEYWKPKVJEEQKTIVAVERKCIVGE6TSHKRHVKUY= | trrs --in-type base32 --out-type base64
# QUxMWU9VUkJBU0VBUkVCRUxPTkdUT1VT
echo -n QUxMWU9VUkJBU0VBUkVCRUxPTkdUT1VT         | trrs --in-type base64 --out-type hex
# 414c4c594f55524241534541524542454c4f4e47544f5553

# Reading and writing files
echo -n 414c4c594f55524241534541524542454c4f4e47544f5553 > hex
trrs --in hex    --in-type hex    --out base64 --out-type base64
trrs --in base64 --in-type base64 --out base32 --out-type base32
trrs --in base32 --in-type base32 --out ascii  --out-type ascii

cat ascii
# ALLYOURBASEAREBELONGTOUS

Tips

# A shorthand exists to convert between encodings without using --in-type and --out-type.

# This means that this:
echo -n 'hello world' | trrs ascii base64
# is equivalent to this:
echo -n 'hello world' | trrs --in-type ascii --out-type base64

Dependencies

~16–27MB
~330K SLoC