What you get is a string containing the bytestream from your RFID reader. Use String#unpack
1 to convert the byte string to actual bytes (numbers).
random_bytes_from_reader = "\xE2\x10\x42\x23\xA9"
random_bytes_from_reader.unpack('C*') # assume we have unsigned chars
#=> [226, 16, 66, 35, 169]
You already figured out how to display them as hex strings with number.to_s(16)
.
1 Read the documentation! The param of unpack
depends on the specification of your RFID reader. 'C*'
was just a guess on my part.