You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
encoding/Base64: use Buffer when native Uint8Array base64 is unavailable #10807
Base64.decode and Base64.encode use Uint8Array.fromBase64 and Uint8Array.prototype.toBase64 only when they exist. They don't exist in Node 24, so Effect falls back to a JavaScript loop. Everything built on it pays for that loop, including S.Uint8ArrayFromBase64.
For a 256-byte value (base64-repro.mjs):
Effect
Buffer
Decode
655 ns
128 ns
Encode
411 ns
121 ns
What is the feature you are proposing to solve the problem?
Use the native Uint8Array methods when present, then Buffer when globalThis.Buffer exists (Node, Bun, Deno), then the current loop.
What alternatives have you considered?
Calling Buffer directly in application code. That doesn't help code paths that go through Effect, such as S.Uint8ArrayFromBase64.
Activity