Hello guys,
I need little help. It’s any way to declare 8bits signed integer in
ruby?
For expamle:
test =
“\x75\x63\x32\x21\x01\xA9\x94\x94\x94\x94\x94\x94\x94\x94\x94\x0a\x85”
result = 0
for i in 0…test.length - 1
result += (test[i].unpack(‘c’)[0])
end
puts result.to_s(16)
I need result in HEX. Yeah, I know result in example will be wrong,
because correct result is 0x98
Thanks!