JavaScript: base64url as per RFC4648

I'm looking for a (fast) standard implementation for base64url as per RFC4648 in JavaScript.

So far I have come up with:

var base64url = window.btoa(url).replace(/\//g, '_').replace(/\+/g, '-').replace(/=/g, '');

      

Anything faster?

+3


source to share





All Articles