Summary
The toBase64 utility in src/internal/utils/base64.ts crashes with a "Maximum call stack size exceeded" error when processing inputs larger than ~100KB in environments without Node.js Buffer (standard browsers, Cloudflare Workers, etc.).
Reproduction
In a browser or worker:
const large = new Uint8Array(200 * 1024);
toBase64(large); // Crashes with RangeError: Maximum call stack size exceeded
Summary
The
toBase64utility insrc/internal/utils/base64.tscrashes with a "Maximum call stack size exceeded" error when processing inputs larger than ~100KB in environments without Node.jsBuffer(standard browsers, Cloudflare Workers, etc.).Reproduction
In a browser or worker: