Latest commit dd24b77 May 21, 2020 History
You can now add special sentinel values for CBOR null and undefined.  Just set

	cbor.null
	cbor.undefined

or

	cbor_s.null
	cbor_s.undefined

(depending upon the module you are using) to some unique value.  If this value
is seen when encoding, the respective CBOR value is used, and this value will
be used when decoding.  Example:

	cbor = require "org.conman.cbor"

	cbor.null      = {} -- unique values
	cbor.undefined = {}

	a = { alpha = 1 , beta = cbor.null , gamma = cbor.undefined }
	b = cbor.encode(a)
	c = cbor.decode(b)
	-- a should be equal to c
1 contributor

Users who have contributed to this file