This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Byte by Byte Decoding
#2
For numbers up to 4 bytes you can use this function:
Code:
function getbyte(value, byte)
  return bit.band(bit.rshift(value, byte * 8), 0xFF)
end

value = 46124

b0 = getbyte(value, 0) -- 44
b1 = getbyte(value, 1) -- 180
b2 = getbyte(value, 2) -- 0
Reply


Messages In This Thread
Byte by Byte Decoding - by savaskorkmaz - 11.11.2020, 16:57
RE: Byte by Byte Decoding - by admin - 12.11.2020, 07:18

Forum Jump: