Lua MsgPack library written in C.
-
Clone the code to the
3rd
directory. -
Run the
make build
command to start compiling. -
If there are no errors, the compilation is successful.
local msgpack = require "msgpack"
local msgpack = require "msgpack"
-- map
print(msgpack.encode { a = 1, b = 2, c = 3, list = { 'a', 'b', 'c' } })
-- array
print(msgpack.encode { true, false, null, 1, 2.2, "admin", list = { 1, 2 3}, map = { a = 1} })
require "utils"
local msgpack = require "msgpack"
var_dump(msgpack.decode('\x82\xa1a\xc2\xa1b\xc3'))
var_dump(msgpack.decode('\x92\xc2\xc3'))