码迷,mamicode.com
首页 > Web开发 > 详细

js 解析 bytearray 成 字符串

时间:2014-10-13 14:21:49      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   os   ar   java   sp   

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 成 字符串

标签:style   blog   http   color   io   os   ar   java   sp   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!