Skip to content

Instantly share code, notes, and snippets.

@Santarh
Created August 19, 2012 05:04
Show Gist options
  • Save Santarh/3392201 to your computer and use it in GitHub Desktop.
Save Santarh/3392201 to your computer and use it in GitHub Desktop.
ruby hex2bin
#
# input txt style
# 00 00 14 66 2a ...
#
input = open("input.hex")
output = open("output.bin", "w")
while line = input.gets
a = line.split.collect{|c| c.hex}
output.write a.pack("C*")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment