Sujet : Re: xxd -i vs DIY Was: C23 thoughts and opinions
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 03. Jun 2024, 11:01:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240603130145.00003b0b@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Mon, 3 Jun 2024 07:49:00 -0000 (UTC)
Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Wed, 29 May 2024 21:31:54 +0100, bart wrote:
Conclusion: beating xxd is apparently not hard if even a scripting
language can do so. I wonder what slows it down?
It’s written in a very stdio-dependent vanilla C style.
So are all our [much much faster] mini-utils.
Have a look at the source for yourself. It’s part of the “vim”
package on Debian and no doubt other distros. The xxd binary itself
is built from a single source file of just some 1200 lines, and the
hex-to-binary conversion is done in a function called “huntype” of
just 133 lines.
The question was about binary-to-hex rather than hex-to-binary.
BTW, it seems that 'xxd -i -r' does not work at all. Or, at least, I was
unable to figure out right combination of flags.