bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66698: I think hex decoding with basenc -d --base16 should be case-i


From: Pádraig Brady
Subject: bug#66698: I think hex decoding with basenc -d --base16 should be case-insensitive
Date: Mon, 23 Oct 2023 13:01:17 +0100
User-agent: Mozilla Thunderbird

On 23/10/2023 10:37, Niels Möller wrote:
Hi,

the docs for basenc --base16 says "hex encoding (RFC4648 section 8)".
The referenced section in that RFC says

   Essentially, Base 16 encoding is the standard case-insensitive hex
   encoding and may be referred to as "base16" or "hex".

I think it would be both more useful, and consistent with docs, if
basenc -d --base16 accepted either upper- or lowercase hex digits.

Current behavior, with basenc (GNU coreutils) 9.1:

   $ echo 666F6F0A |basenc --base16 -d
   foo
   $ echo 666F6f0A |basenc --base16 -d
   fobasenc: invalid input

I think both inputs should give the same output, "foo\n", at least by
default. Possibly configurable with options like --strict, --upper,
--lower, etc (--upper/--lower would be useful also for the --base16
encoding, i.e., no -d).

Agreed.
Will apply the attached later.
Marking this as done.

thanks,
Pádraig

Attachment: basenc-lower-hex.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]