September 2019 front-end download and upload of summary use blob

blob of use

Some concepts: binaryString, UTF-8, UTF-16

String is encoded in UTF-16 in js, 2 bytes per character, binaryString js is a subset string, used to represent the binary data, its actual character content only one byte , but the code point 0-255 utf-16 is encoded so that 2 bytes

have passed the API blob utf-8 encoded string are, preferably for the transfer of binary data is transmitted raw data blob ArrayBuffer (TypeArray). If binaryString, you can start with charCodeAt turn into Uint8Array, and then pass the blob

 

Nuggets - pure front-end download summary  https://juejin.im/post/5c3c4b3551882524a5420119

Guess you like

Origin www.cnblogs.com/natsu07/p/11445720.html