将字符串转换为 Uint8Array
const uint8Array = strToUint8Array("hello");console.log(uint8Array); // 输出 Uint8Array(5) [104, 101, 108, 108, 111] Copy
const uint8Array = strToUint8Array("hello");console.log(uint8Array); // 输出 Uint8Array(5) [104, 101, 108, 108, 111]
需要转换的字符串
转换后的 Uint8Array
将字符串转换为 Uint8Array
Example