将字节字符串转换为 Uint8Array,每个字符的 charCode 作为一个字节。
需要转换的字节字符串。
Uint8Array。
const buffer = byteStringToBuffer('Hello');console.log(buffer); // Uint8Array [72, 101, 108, 108, 111] Copy
const buffer = byteStringToBuffer('Hello');console.log(buffer); // Uint8Array [72, 101, 108, 108, 111]
将字节字符串转换为 Uint8Array,每个字符的 charCode 作为一个字节。