B
Ben Aroia
Hello. I have a file that contains several values that I would like to
read in as hex values (e.x. 3F 5A 6B 43 0E 2F AE...) I have some partial
code:
def getHash(file_in)
f = File.new(file_in, "r")
f.each_byte {|x| print x.to_s+"\n"}
#need something here
end
I would like to extract the hex values from a known offset for a
specific length, and I'm quite sure I can do that by accelorating the
pointer a bit with a simple for loop. I come from a Java background and
new to ruby so any help would be great. Thanks
read in as hex values (e.x. 3F 5A 6B 43 0E 2F AE...) I have some partial
code:
def getHash(file_in)
f = File.new(file_in, "r")
f.each_byte {|x| print x.to_s+"\n"}
#need something here
end
I would like to extract the hex values from a known offset for a
specific length, and I'm quite sure I can do that by accelorating the
pointer a bit with a simple for loop. I come from a Java background and
new to ruby so any help would be great. Thanks