local n={}function n.bytes_to_uint32(n,W,Y,v)return((n*16777216+W*65536)+Y*256)+v end function n.uint32_to_bytes(n)local W=n%256 n=(n-W)/256 local Y=n%256 n=(n-Y)/256 local v=n%256 local g=(n-v)/256 return g,v,Y,W end return n
local common = {}

-- Merges four bytes into a uint32 number.
function common.bytes_to_uint32(a, b, c, d)
   return a * 0x1000000 + b * 0x10000 + c * 0x100 + d
end

-- Splits a uint32 number into four bytes.
function common.uint32_to_bytes(a)
   local a4 = a % 256
   a = (a - a4) / 256
   local a3 = a % 256
   a = (a - a3) / 256
   local a2 = a % 256
   local a1 = (a - a2) / 256
   return a1, a2, a3, a4
end

return common
