5 comments

[ 1.9 ms ] story [ 24.3 ms ] thread
A useful tool to throw together real quick: something that takes `hexdump -C` (or Go's `hex.Dump`, or whatever) and converts it back to binary.
You may want to try xxd -r. https://linux.die.net/man/1/xxd

Of course, if you're just looking for a fun programming exercise, then don't let me stop you :)

Just checked, and on macOS at least, `xxd -r` doesn't properly parse `hex.Dump`.
Speaking of macOS, I like the Hex Fiend application to display/edit files in hexadecimal (though it cannot be used on the command line).
Instead of hexdump one can use od, "octal dump". For example,

     echo xyz|od -An -tx1|xxd -p -r