Skip to content

Lua MsgPack library written in C.

License

Notifications You must be signed in to change notification settings

CandyMi/lua-msgpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-msgpack

Lua MsgPack library written in C.

Install

  1. Clone the code to the 3rd directory.

  2. Run the make build command to start compiling.

  3. If there are no errors, the compilation is successful.

Usage

local msgpack = require "msgpack"

1. encode

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} })

2. decode

require "utils"
local msgpack = require "msgpack"

var_dump(msgpack.decode('\x82\xa1a\xc2\xa1b\xc3'))
var_dump(msgpack.decode('\x92\xc2\xc3'))

LICENSE

MIT

About

Lua MsgPack library written in C.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published