Hacker News new | ask | show | jobs
by tomashubelbauer 2350 days ago
> Also; relying on base64url is odd as there are no built in functions in JavaScript to encode and decode it.

I'm probably missing something, but aren't window.atob and window.btoa just that? It's not available in Node though.

1 comments

btoa is base64 not base64url. And even if it was base64url, it takes a "binary string", so using it on, say, a Uint8Array is non-trivial.
Thank you, I didn't realize the URL safe variant of Base64 had a name and that it was this!