Age | Commit message (Collapse) | Author |
|
|
|
Add new toy `base32`. Add tests for `base32`.
base32 is added by adapting the base64 encode/decode function to also do
base32 encoding/decoding. Then their respective main functions set up
the global parameter `n` to be the number of bits used in the encoding
(5 for base32 and 6 for base64) and `align` to align the result to a
certain length via padding. These are deliberately kept as parameters to
enable future expansion for other bases easily.
|
|
|
|
Be consistent about upper versus lower case. (Upper seems to have the
majority, so I went with that, though I'm happy to provide the opposite
patch as long as we're consistent!)
Be consistent about using \t. (Though saving a few bytes seems like it
might be better done in the code that generates help.h rather than
directly in the source, since tabs make careful ASCII art layout hard
enough that we regularly have things misaligned.)
Remove trailing periods (most of which seem to have been added by me).
Always use the US "human readable" rather than my British
"human-readable", and be more consistent about declaring whether we're
showing multiples of 1000 or 1024.
Just say "verbose" rather than adding a useless "mode" or "output".
|
|
|
|
|
|
|
|
The tizen guys wanted this. Yeah, I know there's base64 code in
uuencode/uudecode, but that this has -i, input lines aren't of fixed length,
encode/decode are in same file, there's no prefix/suffix code, it always
writes to stdout... Eliminating the code duplication wouldn't be worth
the if/else I'd have to add, so I just did a new one.
Factored out the base64 table init into lib.c though: that was worth sharing.
|