# Module /codec/cbor

Compact Concise Binary Object Representation (CBOR, RFC 8949) encoder and decoder for Tangu values.

```tangu
(use /codec/cbor)
```

## Functions & symbols

### decode

`(decode bytes) -> Any`

Decodes a CBOR byte `Slab` back into native Tangu values.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `bytes` | `Slab` | no | CBOR-encoded binary Slab |

```tangu
(let val (cbor/decode raw))
```

### encode

`(encode value) -> Slab`

Encodes a Tangu data structure as a compact CBOR binary `Slab`.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `value` | `Any` | no | Tangu value (Map, Array, String, Int, Float, Bool) to serialize |

```tangu
(let raw (cbor/encode {:id 1 :ok true}))
```
