lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


  I'm proud to announce the release of org.conman.cbor 1.0.0, the most
comprehensive CBOR module in the Lua universe (to mangle a quote from
daurnimator).  This is the full CBOR monty---all items from RFC-7049 [1] and
all registered extentions from the IANA [2].  Easy to use:

	local cbor = require "org.conman.cbor"

	data =
	{
	  name = "Sean Conner",
	  userid = "spc476",
	  login = 
	  {
	    active = true,
	    lastlogin = os.time(),
	  }
	}

	enc = cbor.encode(data)
	new = cbor.decode(enc)

but we can also deal with degenerate cases like this:

	x = {}
	x.x = x

	-- 2nd parameter is starting offset,
	-- 3rd parameter informs cbor.encode() to deal with cycles

	enc = cbor.encode(data,1,{})

  Available via LuaRocks [3] and on github [4].

  -spc (Download and enjoy)

[1]	http://tools.ietf.org/html/rfc7049

[2]	http://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml

[3]	https://luarocks.org/modules/spc476/org.conman.cbor

[4]	https://github.com/spc476/CBOR