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 :)
Of course, if you're just looking for a fun programming exercise, then don't let me stop you :)