Are there any methods in JavaScript that could be used to encode and decode a string using base64 encoding?
In Node.js we can do it in simple way
var base64 = 'SGVsbG8gV29ybGQ=' var base64_decode = new Buffer(base64, 'base64').toString('ascii'); console.log(base64_decode); // "Hello World"