simon-git: base64 (master): base64.git
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Sep 21 18:42:10 BST 2016
TL;DR:
ef69fb9 Refactor to make it easy to drop in other encodings.
807326a Add --hex (and --HEX) encoding options.
9470def Remove chars-per-line divisibility constraint.
d7ecf46 Fix spurious newline output when encoding no data.
b200977 Update the copyright date.
Repository: git://git.tartarus.org/simon/base64.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=base64.git
Branch updated: master
Committer: base64.git
Date: 2016-09-21 18:42:10
commit ef69fb96f1ddea5b54e8a7f98fa3b193937b2777
web diff http://tartarus.org/~simon-git/gitweb/?p=base64.git;a=commitdiff;h=ef69fb96f1ddea5b54e8a7f98fa3b193937b2777;hp=017c69bf19fd49ad5357925dd0266ea75566e6c1
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Sep 19 08:43:02 2016 +0100
Refactor to make it easy to drop in other encodings.
I've recently found myself having to encode and decode a few times
between binary data and straight-up ASCII hex, and this utility seems
like a convenient existing place where I can drop that in as another
option.
Of course the name 'base64' then becomes slightly silly, but better
that than make it so generic I can never remember it.
base64.c | 74 ++++++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 51 insertions(+), 23 deletions(-)
commit 807326a3d013a1f17decd2b828ec70476f05b13c
web diff http://tartarus.org/~simon-git/gitweb/?p=base64.git;a=commitdiff;h=807326a3d013a1f17decd2b828ec70476f05b13c;hp=ef69fb96f1ddea5b54e8a7f98fa3b193937b2777
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Sep 19 08:43:28 2016 +0100
Add --hex (and --HEX) encoding options.
I've set the partial fill character to '0', which means that an input
consisting of an odd number of hex digits will be treated as if it has
a trailing '0', so the last hex digits will be the MSB of a byte.
This is a bit odd, but I think less odd than the alternative of
treating it as the LSB; this way, there's a more consistent answer to
the question 'if _this_ hex digit became _those_ four bits of the
output file, where can I find the four bits corresponding to the
next/previous one?'
base64.but | 8 ++++++++
base64.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 68 insertions(+), 1 deletion(-)
commit 9470def1484dc143eec656493cf05a8a694ae3d2
web diff http://tartarus.org/~simon-git/gitweb/?p=base64.git;a=commitdiff;h=9470def1484dc143eec656493cf05a8a694ae3d2;hp=807326a3d013a1f17decd2b828ec70476f05b13c
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Sep 19 08:49:57 2016 +0100
Remove chars-per-line divisibility constraint.
It was only laziness that made me put it in in the first place; it's
pretty trivial to get rid of it, so while I'm here, why not?
base64.but | 6 ------
base64.c | 22 +++++++++-------------
2 files changed, 9 insertions(+), 19 deletions(-)
commit d7ecf467db3ef7942a2d12ea1d1acb8b56c881bf
web diff http://tartarus.org/~simon-git/gitweb/?p=base64.git;a=commitdiff;h=d7ecf467db3ef7942a2d12ea1d1acb8b56c881bf;hp=9470def1484dc143eec656493cf05a8a694ae3d2
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Sep 19 08:51:42 2016 +0100
Fix spurious newline output when encoding no data.
In the encoding output loop, we now print the \n _after_ rather than
before each character. The effect is that where previously we would
always end the loop with a partial line output _except_ when the loop
ran zero times (hence the bug due to overlooking that special case),
we now end the loop with a partial line output only if the last line
is not a multiple of cpl, so the condition for needing a trailing
newline is simply that column > 0, which doesn't require us to count
the input bytes.
base64.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
commit b2009773881a0367047d70e86cb4c3196d403265
web diff http://tartarus.org/~simon-git/gitweb/?p=base64.git;a=commitdiff;h=b2009773881a0367047d70e86cb4c3196d403265;hp=d7ecf467db3ef7942a2d12ea1d1acb8b56c881bf
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Sep 19 08:55:02 2016 +0100
Update the copyright date.
base64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
More information about the tartarus-commits
mailing list