Function: encodeBase64()
ts
function encodeBase64(bytes: Uint8Array): string;Defined in: src/lib/helpers/base64.ts:33
Encode a Uint8Array as a base64 string.
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | Uint8Array | The buffer to encode. |
Returns
string
The base64 representation.
Remarks
Prefers Buffer.from(bytes).toString('base64') when globalThis.Buffer exists; otherwise chunk-encodes through btoa with a 0x8000-byte window to avoid Maximum call stack size exceeded on large buffers.