> I'm not sure whether it is possible to detect the native endianess > and/or integer word size in pure Lua In Lua 5.3, you can: a=string.packint(1) print(#a) -- native lua_Integer size print(a:byte(1,1)) -- native endianness