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);
二进制转换为字符串
参考 http://stackoverflow.com/questions/3195865/converting-byte-array-to-string-in-javascript
时间: 2024-10-03 22:40:30