-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
The HTML specification has two methods for converting between a unicode string to a base64-encoded representation of it, and vice versa.
The URL-safe base64 encoding (base64url), also defined in RFC4648, has been adopted by a few specifications recently. Examples include the Push API (PushSubscription serialization) and various parameters of JWK objects (EME, Web Crypto).
While the contents aren't immediately intended for consumption by the web app, those which would like to now need their own conversion methods. (As trivial as that may be.)
The naming of btoa/atob doesn't make it very extensible. We could either add an argument (optional boolean urlsafe = false), or introduce methods analogous to them for the different encoding - urlbtoa/urlatob? I prefer the former.
I'd be happy to generate a pull request if you think adding these makes sense.