Answers for "response to base64 js"

35

javascript base64 encode

var string = "Hello folks how are you doing today?";
var encodedString = btoa(string); // Base64 encode the String
var decodedString = atob(encodedString); // Base64 decode the String
Posted by: Guest on July-31-2019
1

js decode base64

let str = 'bmltZXNoZGV1amEuY29t';
let buff = new Buffer(str, 'base64');
let base64ToStringNew = buff.toString('utf8');
Posted by: Guest on March-25-2022
1

base64 to base64url javascript

/**
 * Function that converts a base64 string into a base64url string
 * @param {string} input - The string to convert
 */
function base64ToBase64url(input) {
  // Replace non-url compatible chars with base64url standard chars and remove leading =
  return input
    .replace(/\+/g, '_')
    .replace(/\//g, '-')
    .replace(/=+$/g, '');
}
Posted by: Guest on April-11-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language