/**
* 解析 byteArray 成 字符串
* @param {byte数组} array
*/
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);
但是这里会有个问题,如果是中文数据的情况下会乱码,可参考
https://www.jianshu.com/p/2a9e82f48540 方案替换