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
javascript base64 url-encoding urlencode


source to share


No one has answered this question yet

Check out similar questions:

7649
How does JavaScript blocking work?
7494
How can I remove a specific element from an array in JavaScript?
7432
How to check if a string contains a substring in JavaScript?
7287
What does "use strict" do in JavaScript, and what are the reasons for it?
5722
How can I remove a property from a JavaScript object?
5670
Which operator is equal (== vs ===) should be used in JavaScript comparisons?
5101
What's the most efficient way to deeply clone an object in JavaScript?
4829
How do I include a JavaScript file in another JavaScript file?
4380
For each by an array in JavaScript?
3842
Create GUID / UUID in JavaScript?



All Articles
Loading...
X
Show
Funny
Dev
Pics