I have the following text string that represents hexadecimal bytes that should appear in file to create.
str = "001104059419632801001B237100300381010A"
I want to create a file that contains the above string in order when I open the created file with a Hex editor I see the same bytes
When I run this script
File.open("out.dat", 'w') {|f| f.write(str.unpack('H*')) }
it creates the file out.dat and when I open this file in a Hex editor contains this
5B2233303330333133313330333433303335333933343331333933363333333233383330333133303330333134323332333333373331333033303333333033303333333833313330333133303431225D
and I would like the content when I open the file in Hex editor be the same a text string
001104059419632801001B237100300381010A
How can I do this?
I hope make sense. Thanks