1
0
Fork
You've already forked llbin
0
simple and portable binary serialisation for lua
Lua 100%
2025年11月26日 00:20:33 +00:00
llbin.lua initial commit 2025年11月26日 00:20:33 +00:00
README.md initial commit 2025年11月26日 00:20:33 +00:00

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!