binco is a CLI-oriented binary-text encoder and decoder.
Currently supports:
array_c: C array (encoding only)array_csharp: C# array (encoding only)array_d: D array (encoding only)ascii85: Ascii85base16: Hexadecimalbase64: Base64base64u: Base64 URL without padding, RFC 4648 and 7515base64up: Base64 URL with paddingbase91: basE91intelhex,ihex: Intel HEX (entry types00and01only)srecord,srec: Motorola S-Recorduuencode: UUEncodingxxencode: XXEncoding
Why? Well, I want to stop using random websites for this sort of thing.
An encoding (using -e) or decoding (-d) scheme needs to be specified.
By default, stdin and stdout streams are used for input and output.
To specify a file input, use -i|--input. For file output, use -o|--output.
Encode file and show result to stdout:
$ binco -e base64 -i dub.sdl
bmFtZSAiYmluY28iCmRlc2NyaXB0aW9uICJCaW5hcnkgRW5jb2Rlci9EZWNvZGVyIgphdXRob3Jz
ICJkZDg2ayA8ZGRAZGF4Lm1vZT4iCmNvcHlyaWdodCAiQ29weXJpZ2h0IMKpIDIwMjMsIGRkODZr
IDxkZEBkYXgubW9lPiIKbGljZW5zZSAiQlNELTMtQ2xhdXNlLUNsZWFyIgoKdGFyZ2V0VHlwZSAi
ZXhlY3V0YWJsZSIKCnN0cmluZ0ltcG9ydFBhdGhzICIuIg==Encode stream to base64:
$ echo 123 | binco -e base64
MTIzIA0KEncode file as a C array:
$ binco -i bin -e array_cDecode file to another file:
$ binco -i example.txt -d base64 -o example.exeTranscode a file to another encoding:
$ binco -i a.txt -d base16 -e base64 -o b.txtCurrently, due to a limitation to File.byLine, only the \n line terminator
is understood by the decoder.
To build binco, you'll need any D compiler (dmd, gdc, ldc) and dub.
Tests: dub test
Debug build: dub build
Release build: dub build -b release
With LDC: dub build -b release --compiler=ldc2