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);

 

二进制转换为字符串

参考 http://stackoverflow.com/questions/3195865/converting-byte-array-to-string-in-javascript


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM