Bun

指南二進位制資料

使用 Bun 將 ArrayBuffer 轉換為字串

Bun 實現了 Web 標準的 TextDecoder 類,用於在二進位制資料型別和字串之間進行轉換。

const buf = new ArrayBuffer(64);
const decoder = new TextDecoder();
const str = decoder.decode(buf);

有關使用 Bun 操作二進位制資料的完整文件,請參閱 文件 > API > 二進位制資料