Why not add a base16 into coreutils?

345 Views Asked by At

Both base32 and base64 CLI utils are part of gnu coreutils. So, why not add a base16?

3

There are 3 best solutions below

0
user115517 On BEST ANSWER

writing a script and had the same thought...

Just looked though the NEWS in coreutils. https://github.com/coreutils/coreutils/blob/master/NEWS

It looks like they added basenc in release 8.31 (2019-03-10)

** New commands - basenc is added to complement existing base64,base32 commands, and encodes and decodes printable text using various common encodings: base64,base64url,base32,base32hex,base16,base2,z85.

Makes sense to have one command... I've done this other ways in the past xxd, hexdump, etc...

So they kind of did. Just use basenc --base16

*Edit, actually it is the same source code for all three https://github.com/coreutils/coreutils/blob/master/src/local.mk

src_base64_SOURCES = src/basenc.c
src_base64_CPPFLAGS = -DBASE_TYPE=64 $(AM_CPPFLAGS)
src_base32_SOURCES = src/basenc.c
src_base32_CPPFLAGS = -DBASE_TYPE=32 $(AM_CPPFLAGS)
src_basenc_SOURCES = src/basenc.c
src_basenc_CPPFLAGS = -DBASE_TYPE=42 $(AM_CPPFLAGS)
0
KamilCuk On

GNU coreutils is free. It's people very, very hard work they are doing for free. You are using it completely for free. How much have you donated? Donate them. Pay them if you want something.

Why not add a base16 into coreutils?

It costs work, both implementing, but mostly the never ending maintenance. If something is not needed, it's better not to add it and reduce the work and concentrate on what's important. Maintaining current commands, so they are up-to-date with all systems and be consistent and work, is way more important. Some even say, that (especially in open-source) a project leader has most importantly decide what features to reject, not which to add.

So, how much will you pay for implementing and then endless maintaining a base16 utility in GNU coreutils?

0
ng256 On

In my opinion, this is due to the fact that hex encoding doubles the amount of data being encoded. This approach was deemed inappropriate.
P.S. Here is a C# example of the console tool that provides base16 encoding. Application input can be obtained from files, command line, keyboard or by redirecting output from another console application according to so called "Unix way" software. Unfortunately, it uses the Windows API but can be redesigned for Linux.