How to use the encodeURI function from js-base64

Find comprehensive JavaScript js-base64.encodeURI code examples handpicked from public code repositorys.

1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
 * @param  {String} str - Origin string
 * @return {String}     - base64 value
 */
var getBase64 = toolkit.getBase64 = function getBase64(str, uriSafe) {
  if (uriSafe) {
    return Base64.encodeURI(str);
  } else {
    return Base64.encode(str);
  }
};
fork icon34
star icon185
watch icon0

+ 2 other calls in file

3
4
5
6
7
8
9
10
11
  var encoded = base64.encode(data);
  return base64.decode(encoded);
}


function roundtrip2(data) {
  var encoded = base64.encodeURI(data);
  return base64.decode(encoded);
}
fork icon2
star icon0
watch icon0

92
93
94
95
96
97
98
99
100
101
        //emailLines.push('<img src="https://wallpapercave.com/wp/wp1962032.jpg" alt=""/>');
        const email =emailLines.join('\r\n').trim(); 

        const gmail = google.gmail('v1');

        const base64EncodedEmail = Base64.encodeURI(email);
        base64EncodedEmail.replace(/\+/g, '-').replace(/\//g, '_')
       // console.log(base64EncodedEmail);

gmail.users.messages.send({
fork icon0
star icon0
watch icon0