2022-05-17 00:18:01 +02:00
|
|
|
# based
|
|
|
|
|
2024-06-10 22:09:18 +02:00
|
|
|
A commandline binary-to-text encoder which has most
|
|
|
|
common bases included.
|
2022-05-17 00:26:31 +02:00
|
|
|
|
2022-09-19 23:11:13 +02:00
|
|
|
Release binary is statically linked and stripped via
|
2022-05-17 20:58:43 +02:00
|
|
|
```sh
|
2022-05-19 23:55:26 +02:00
|
|
|
cabal v2-build --enable-executable-static -O2
|
2022-09-19 23:11:13 +02:00
|
|
|
strip --strip-all based
|
2022-05-17 20:58:43 +02:00
|
|
|
```
|
|
|
|
|
2024-06-10 22:09:18 +02:00
|
|
|
Do not forget to set `$LD_LIBRARY_PATH` to the directory of your static libs,
|
|
|
|
e.g. `export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu`.
|
2024-05-22 22:33:27 +02:00
|
|
|
|
2022-05-17 00:26:31 +02:00
|
|
|
## Compilation
|
|
|
|
|
2022-05-17 20:58:43 +02:00
|
|
|
* If you want to compile your own build, link it dynamically via
|
2024-06-10 22:09:18 +02:00
|
|
|
|
2022-05-17 00:26:31 +02:00
|
|
|
```sh
|
2022-05-19 23:55:26 +02:00
|
|
|
git clone https://git.stefan.works/whx/based.git
|
2022-05-17 20:58:43 +02:00
|
|
|
cd based/
|
|
|
|
cabal install
|
2022-05-17 00:26:31 +02:00
|
|
|
cabal run
|
|
|
|
```
|
|
|
|
|
2024-06-10 22:09:18 +02:00
|
|
|
## Download Binary
|
|
|
|
|
|
|
|
If you want to download the statically linked binary, fetch the latest release
|
|
|
|
from https://git.stefan.works/whx/based/releases .
|
|
|
|
|
2022-05-20 00:14:22 +02:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
* Pipe via stdin to transcode
|
2022-05-20 00:16:17 +02:00
|
|
|
* Modes are __encode__ and __decode__
|
2022-05-20 00:14:22 +02:00
|
|
|
* Encoding is done in the following way
|
|
|
|
```sh
|
|
|
|
echo Hello, World! | based encode --b91
|
|
|
|
>OwJh>}AQ;r@@Y?FF
|
|
|
|
```
|
|
|
|
* Decoding is implicated in the following way
|
2022-05-20 00:17:12 +02:00
|
|
|
```sh
|
2022-05-20 00:14:22 +02:00
|
|
|
echo '>OwJh>}AQ;r@@Y?FF' | based --b91
|
2022-05-20 00:17:12 +02:00
|
|
|
Hello, World!
|
2022-05-20 00:14:22 +02:00
|
|
|
```
|
|
|
|
|
2024-05-22 22:36:17 +02:00
|
|
|
### Tests
|
|
|
|
|
|
|
|
Run `cabal test`
|
|
|
|
|
2022-09-19 23:11:13 +02:00
|
|
|
## What is Transcoded?
|
|
|
|
|
|
|
|
The following are the supported encodings
|
2024-06-10 22:09:18 +02:00
|
|
|
|
2022-09-19 23:11:13 +02:00
|
|
|
* Base91
|
|
|
|
* Base85
|
|
|
|
* Base64
|
|
|
|
* Base64url
|
2024-06-10 22:09:18 +02:00
|
|
|
* URL Encoding
|
2022-09-19 23:11:13 +02:00
|
|
|
* Base62
|
|
|
|
* Base58
|
2024-06-10 22:09:18 +02:00
|
|
|
* Base45
|
2022-09-19 23:11:13 +02:00
|
|
|
* Base32
|
2024-06-10 22:09:18 +02:00
|
|
|
* Base16
|
|
|
|
* Base10
|
|
|
|
* Base2
|
2022-09-19 23:11:13 +02:00
|
|
|
* Quoted-Printable
|
|
|
|
* UU Encoding
|
|
|
|
* XX Encoding
|
|
|
|
* yEncoding
|
2024-05-22 22:33:27 +02:00
|
|
|
* Rotate (1..26)
|
2022-09-19 23:11:13 +02:00
|
|
|
|