> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xray.cool/llms.txt
> Use this file to discover all available pages before exploring further.

# base64

> `base64`函数主要是用来将字符串或 bytes 进行 base64 编码

## 函数原型

`func base64(v1 string/bytes) string`

### 参数介绍

| 参数名称 | 参数介绍  |
| ---- | ----- |
| v1   | 待转换数据 |

## 举例

| 待转换数据                 | 转换语句                          | 输出结果       |
| --------------------- | ----------------------------- | ---------- |
| `asdf`                | `base64("asdf")`              | `YXNkZg==` |
| `b"\xac\xed\x00\x05"` | `base64(b"\xac\xed\x00\x05")` | `rO0ABQ==` |
