Uint8Array.prototype.toBase64() and Uint8Array.fromBase64() for encoding and decoding base64 data in Bun. These APIs work directly with bytes, so they are a better fit for binary data than the older btoa() and atob() globals.
TextEncoder and TextDecoder.
Buffer extends Uint8Array, so you can encode buffers with toBase64() and pass them to APIs that accept Uint8Array. Buffer also provides Node.js-compatible base64 decoding with Buffer.from(encoded, "base64").
See Web APIs.