ES6: base64解码
/**
* ES6: base64解码
*/
decodeBase64Content: function (base64Content) {
let commonContent = base64Content.replace(/\s/g, '+');
commonContent = Buffer.from(commonContent, 'base64').toString();
return commonContent;
}
ES6: base64编码
/**
* ES6: base64编码
*/
encodeBase64Content: function (commonContent) {
let base64Content = Buffer.from(commonContent).toString('base64');
return base64Content;
},
ES6 Base64 编解码

本文介绍如何使用ES6进行Base64编码和解码操作,提供了具体的实现方法,包括将普通内容转换为Base64字符串及从Base64字符串还原普通内容。
1806





