Skip to content

kieselsteini/lua-struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lua-struct

A Lua clone of the python.struct module.

Summary

lua-struct is a clone of the python.struct module. This package enables Lua to read/write binary data in a comfortable way.

Example

local bindata = struct.pack('s4hf', 'PACK', 1024, math.pi)

bindata will contain a 4 byte "string" with PACK, a singed short with 1024 and a 8 byte float with PI. Now we're going to unpack it...

print(struct.unpack('s4hf', bindata))

Installation

Need lua 5.2, then just "make" it.

Bugs

  • no bugs I'm aware of...please find some ;)

Todo

  • add more datatypes (e.g. long, long long)

If you have some particular request, just send me an email, and I will see for it!

About

A Lua clone of the python.struct module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published