Skip to main content
Bun 实现了 Web 标准的 atobbtoa 函数,用于编码和解码 base64 字符串。
const data = "hello world";
const encoded = btoa(data); // => "aGVsbG8gd29ybGQ="
const decoded = atob(encoded); // => "hello world"

请参见 文档 > Web API,了解 Bun 实现的 Web API 完整细节。