javascript base64 encode string
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
javascript base64 encode string
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
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, '');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us