首页 > Web开发 > 详细

js 解析 bytearray 成 字符串

时间:2014-10-13 12:23:00      阅读:228      评论:0      收藏:0      [点我收藏+]
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

js 解析 bytearray 成 字符串

原文:http://www.cnblogs.com/freefei/p/4021733.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!