Introducing base64(1)
- Reply: Piotr P. Stefaniak: "Re: Introducing base64(1)"
- Reply: Piotr P. Stefaniak: "Re: Introducing base64(1)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 22 Nov 2021 19:16:45 UTC
Hello archers, I've prepared a short series of changes: https://reviews.freebsd.org/D32943 "Conflate uudecode and uuencode" https://reviews.freebsd.org/D32944 "b64encode: implement -w to wrap lines" https://reviews.freebsd.org/D32945 "Implement base64(1)" First, I modularize uuencode and uudecode by wrapping them in bin2text2bin.c ("binary to text to binary"). The program will be installed as bin2text2bin, uuencode, uudecode, b64encode, and b64decode and will be responsible for running the coders according to their historical behavior. Additionally, bin2text2bin will be able to take a parameter designating the coder and accept all its options in this form: bin2text2bin <coder> [options] and the behavior should be the same as if <coder> [options] was invoked. This has the advantage that adding coders won't require installing them as binaries. I think quoted-printable or yEnc would be nice, but currently I have no plans to implement those. Second, I implement an option to b64encode that sets the column after which lines wrap. Plus, I accidentally optimize the function that produces the encoded output. Third, I use the existing b64encode and b64decode implementation and the newly implemented option to call it as base64, respecting the syntax of that program's invocation. Corrections, bug reports and other thoughts welcome. Piotr