web浏览器中的base64编码解码

最近一个项目需要在页面中将远程图片转为base64字符串并传送,因此激发了我对浏览器中的base64编码解码方式的兴趣。

Base64介绍

Base64是一种基于64个可打印字符来表示二进制数据的表示方法。由于2^6=64,所以每6个位元为一个单元,对应某个可打印字符。3个字节有24个位元,对应于4个Base64单元,及3个字节可由4个可打印字符来表示。在Base64中的可打印字符包括字母A-Z、a-z、数字0-9,这样共有62个字符,此外两个可打印字符号再不同的系统中不同。 ——wiki百科

Base64常用于在通常处理文本数据的场合,表示、传输、存储一些二进制数据,包括MIME的电子邮件及XML的一些复杂数据。

然而前端里接触Base64最多的想必就是Base64图片了,性能优化中很重要的一条就是减少请求,所以一些体积较小的图片可以转为Base64来减少请求量,很多前端框架的脚手架也默认配置了这点。

网页中base64的转换

字符串

window.btoa()方法

window.btoa()函数是从String对象中创建一个base-64编码的ASCII字符串,其中字符串中的每个字符都被视为一个二进制数据字节。别看他名字有够随性的,但就是如名字般简单粗暴。

语法:

1
let encodedData = window.btoa(stringToEncode);

如:

1
console.log(window.btoa('123456abc'));  // 'MTIzNDU2YWJj'

window.atob()方法

从名字也可以看出就是window.btoa()返过来,对用base64编码过的字符串进行解码。

如果传入字符串的长度不是4的倍数,则抛出DOMException。

语法:

1
var decodedData = window.atob(encodedData);

如:

1
console.log(window.atob('MTIzNDU2YWJj'));  // '123456abc'

*越界异常

在各浏览器中,使用 window.btoa对Unicode字符串进行编码都会触发一个字符越界的异常.

先把Unicode字符串转换为UTF-8编码,可以解决这个问题

1
2
3
4
5
6
7
8
9
10
11
function utf8_to_b64( str ) {
return window.btoa(unescape(encodeURIComponent( str )));
}

function b64_to_utf8( str ) {
return decodeURIComponent(escape(window.atob( str )));
}

// Usage:
utf8_to_b64('? à la mode'); // "4pyTIMOgIGxhIG1vZGU="
b64_to_utf8('4pyTIMOgIGxhIG1vZGU='); // "? à la mode"

window.btoa()和window.atob()方法的兼容情况(2018-11-23)

btoa_atob兼容

可以看出兼容情况都很良好

如果要兼容IE——Base.js

编码

使用

1
var encodedData = Base64.encode(stringToEncode);


1
console.log(Base64.encode('123456abc'));  // 'MTIzNDU2YWJj'

解码

使用

1
var decodedData = Base64.decode(encodedData);

如:

1
console.log(Base64.decode('MTIzNDU2YWJj'));  // '123456abc'

文件

如果要实现文件的Base64编码,则需要FileReader。FileReader类型实现的是一种异步文件读取机制。可以把FileReader想象成XMLHttpRequest,区别只是它读取的是文件系统,而不是远程服务器。
具体使用这里不具体介绍,下面有个通过FileReader将test.txt文件编码为Base64的示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function getFileBase64 (file, cb) {
if (!file) throw new Error('Error! no param "file"(getFileBase64()).');

let reader = new FileReader();
reader.onload = function(e) {
let base64 = e.target.result; // 该文件的完整Base64

if (cb) cb(base64);
};
reader.onerror = function () {
alert('Read file fail.');
};
reader.readAsDataURL(file);
}

使用:

1
2
3
4
5
6
7
8
9
10
window.addEventListener("dragenter", function(event) { event.preventDefault(); }, false);
window.addEventListener("dragover", function(event) { event.preventDefault(); }, false);

window.addEventListener("drop", function(event) {
getFileBase64(event.dataTransfer.files[0], function (base64) {
console.log(base64)
});
event.preventDefault();

}, false);

结果(原test.txt内容为“123456abc”):

1
data:text/plain;base64,MTIzNDY1YWJj

目前(2018-11-23)filereader的兼容情况
filereader

图片地址

对于页面中的图片或图片url,可以通过canvas的toDataURL方法进行编码。注意url有域名的限制。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function getImgBase64(urlorImg, cb) {
if (!urlorImg) throw new Error('Error! no param "url"(getImgBase64).')

function getBase64 (imgObj) {
let _width = imgObj.width,
_height = imgObj.height;

canvas = document.createElement('canvas');
canvas.width = _width;
canvas.height = _height;

ctx = canvas.getContext("2d");
ctx.drawImage(imgObj, 0, 0, _width, _height);

return canvas.toDataURL('image/jpeg', 1);
}


if (typeof urlorImg === 'string') { // url
let _img = new Image();
_img.onload = function () {
let img64 = getBase64(_img)

if (cb) cb(img64);
};

_img.onerror = function () {
alert('Image load failed.');
};

_img.src = urlorImg;
} else { // Image Object
let img64 = getBase64(urlorImg)

if (cb) cb(img64);
}
}

使用

1
2
3
getImgBase64('https://fund.10jqka.com.cn/public/181024koi/dist/images/t-2.png', base64 => {
console.log(base64);
});

结果

1
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABLAUoDAREAAhEBAxEB/8QAHgABAAICAwEBAQAAAAAAAAAAAAgJBgcCBAoDBQH/xABFEAABBAICAgECAwMHBBMAAAAEAgMFBgEHAAgJERITFBUWISIxQQoXGFFhcZFXlrfVGSMkJScoMjQ5Q1RYh5ehp9bX2P/EAB0BAQABBQEBAQAAAAAAAAAAAAAFAwQGBwgCAQn/xABZEQACAgEDAwMBBAQFCg8RAAABAgMEBQAGEQcSIRMUMSIIFTJBFiNRYTRxgZGTGCUzNlRXdpWz1BdCUlNVZXN0hbS1ttLT1iQ1N1Zig4SSlJahosTR1ePw/9oADAMBAAIRAxEAPwD2Ec5310Rpxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxppxpp+/93Hz8afHzrjlaMKyjK04XjPrKcqx8sZ9+vWU+/eM+/wBPXr37/Tl22PvpD7h6NxK5HcJ2rTLD2n4b1SgTg/t7uNWSZLHSTe2S/SewD2mulqBpg3gdvpCQyc8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srcc8qB9SMBlke9dhSby3t1BkzlC/LtPb9TAYqrFMvqWq6vLcuW8Y8gEdwXsndXD1Z6rSCNknkdjUv1pJJTdwOxfYeY683Xxr6e8f26YuJqchB6Ig9kxodsvcHY6Rqm0Rg8XZ4PEZq2AjyS74PVY+RKkn5F0QIaYkTXCSjMJLau7liy1eTGw4+cKhFdZQHkVo4mADrxEoJkCAkk8AEnkn4w/ZG19sQbnodVs51KwM012KxuOxipnpY6xVyGZqTNNTsGXMWZUjxzXJIkiWIPI8EUYRI/oa+3o9pqf6+9SNBaftjAolrpevYoa0hBOtPjAWWVcInp+PQUw8QOYsCXlTA3jhnlimvMOFi5wO82nE9RhavUrwvx3pGA4HkBjyzDkcg8EkcjweOR41zh1Bztbc29dyZykzvSv5OZ6ckgKtJUhVK1aUoyqyCWGFJFjdQ8asEf6lJ1Krl1rDtONNONNONNONNONNONNONNONNfMtcwaNiNes9kRB4ynP4AHKuR0Y4j6mXnRyMRyBTCwinc5UYAUY8GY2t4Yph4Qh4deX47fGfxGOr4/GSUaftmkMV5MZRlyaiSRpgEu2YJpK7xSMXgs1RBciIAWz2qoGv8ANdNdubhytjJ5qXNXorJgabDnNX6uElMESRBZ6NKWsbVeZY09zRty2KFn61mrPHJIjckIQ2hDbaEtttpShCEJwlCEJxhKUISnGEpSlOMYSnGMYxjGMYxjGOYnLLLPLJNNJJNNNI8sssrtJLLLIxeSSSRyXeR3JZ3YlmYlmJJJ1nkMMNeGKvXijgrwRpDBBDGsUMMMShIoookCpHHGiqiRooVFAVQAANcueNVNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNONNf/9k=

总结

  • 简单的字符串转换,可使用window.btoa()方法,要兼容IE则需引用Base64.js并使用对应方法;
  • 对于页面中图片、或同域名图片url的转换,可以使用基于canvas的getImgBase64()方法;
  • 对于文件可以使用基于FileReader的getFileBase64()方法;

参考资料: