Data & codecs2 exports
Raw Markdown/codec/cbor
Compact Concise Binary Object Representation (CBOR, RFC 8949) encoder and decoder for Tangu values.
Functions & symbols#
decode#
function
Decodes a CBOR byte `Slab` back into native Tangu values.
| Parameter | Type | Optional | Description |
|---|---|---|---|
bytes | Slab | required | CBOR-encoded binary Slab |
Returns:
Any(let val (cbor/decode raw))encode#
function
Encodes a Tangu data structure as a compact CBOR binary `Slab`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
value | Any | required | Tangu value (Map, Array, String, Int, Float, Bool) to serialize |
Returns:
Any(let raw (cbor/encode {:id 1 :ok true}))