In Linux bash shell, I use the following to convert a plain hexadecimal dump into binary
$ echo "8cd59ef53c9aaa68311b73767e0975e7" | xxd -r -p > xxd_out.bin
when I open the file in text viewer it looks like ŒÕžõ<šªh1sv~ uç
or in xxd
$ xxd -b xxd_out.bin
00000000: 10001100 11010101 10011110 11110101 00111100 10011010 ....<.
00000006: 10101010 01101000 00110001 00011011 01110011 01110110 .h1.sv
0000000c: 01111110 00001001 01110101 11100111 ~.u.
or in Notepad++ Hex-Editor (plugin) view
How can I get the same binary output in Ruby ? Is there any library available which does what xxd -r -p
would do ?