Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2021 19:16:45 +0000
From:      "Piotr P. Stefaniak" <pstef@freebsd.org>
To:        freebsd-arch@freebsd.org
Subject:   Introducing base64(1)
Message-ID:  <YZvsnRwtPHmyinKM@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YZvsnRwtPHmyinKM>