Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

btoa in js string only

// if this is your Base64 encoded string
var str = 'VGhpcyBpcyBhbiBhd2Vzb21lIHNjcmlwdA=='; 

// make URL friendly:
str = str.replace(/+/g, '-').replace(///g, '_').replace(/=+$/, '');

// reverse to original encoding
str = (str + '===').slice(0, str.length + (str.length % 4));
str = str.replace(/-/g, '+').replace(/_/g, '/');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #btoa #js #string
ADD COMMENT
Topic
Name
7+3 =