js 解析 bytearray 成 字符串

function bin2String(array) {
  return String.fromCharCode.apply(String, array);
}

var bit=[104,101,108,108,111,32,119,111,114,108,100];

var tostring=bin2String(['104','101','108','108','111','32','119','111','114','108','100']); // "hello word"
    console.log(tostring);

你可能感兴趣的:(js 解析 bytearray 成 字符串)