lua-struct
lua-struct copied to clipboard
Implementation of binary packing/unpacking in pure lua
``` lua struct.pack('l', -2) "\0\0\0\0\0\0\0\0" -- should be "\254\255\255\255\255\255\255\255" ``` I guess [i was wrong](https://github.com/iryont/lua-struct/issues/2#issuecomment-133541030) that leaving this was okay: ``` lua if val < 0 then val = val...
I faced the need to unpack zero-terminated strings where each character is 2 bytes in big-endian (hi-lo) order, even as most all strings are ASCII range. So what i added...
thank you for making the library available. I would like to draw your attention to a few things that I can help others In that LUA library using `2B` `4B...
The code i am trying to port and uses `struct` needs this feature of Ierusalimschy's `struct.unpack`: > ... After the read values, this function also returns the index in s...
Minor improvement, so 'c' format can be handled for single characters w/o `n` appended (i.e. 'c', not only 'c1'): ``` lua local n = format:sub(i + 1):match('^%d+') or '' local...