simple and portable binary serialisation for lua
| llbin.lua | initial commit | |
| README.md | initial commit | |
llbin
(WARNING: this current version has some pretty significant precision loss in floating point numbers as it stores the mantissa with 31 bits, where lua generally stores it with 53. this'll be fixed soon, give it a day or two)
llbin is a very simple portable serialisation library for lua objects. it does not serialise more complex data, including functions, userdata, and the metatables of tables.
local bin = require 'llbin'
local foo = { 4 }
local bar = { 'bar' }
local baz = { true }
foo.next = bar
bar.next = baz
local s = bin.to(foo) -- returns a regular, portable string
local o = bin.from(s) -- and so we've got our table back!