# Module /base64

RFC 4648 standard and URL-safe Base64 encoding and decoding for strings and byte slabs.

```tangu
(use /base64)
```

## Functions & symbols

### decode-base64

`(decode-base64 encoded) -> String`

Decodes a Base64 string into a UTF-8 `String`.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `encoded` | `String` | no | Base64-encoded string |

```tangu
(base64/decode-base64 "aGVsbG8=") ; -> "hello"
```

### decode-base64-slab

`(decode-base64-slab encoded) -> Slab`

Decodes a Base64 string into raw binary `Slab` bytes.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `encoded` | `String` | no | Base64-encoded string |

```tangu
(let raw (base64/decode-base64-slab b64))
```

### encode-base64

`(encode-base64 input) -> String`

Encodes a `String` or byte `Slab` into standard Base64.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `input` | `String | Slab` | no | UTF-8 text or binary Slab |

```tangu
(base64/encode-base64 "hello") ; -> "aGVsbG8="
```
