JavaScript中将ArrayBuffer转换为ASCII字符串

function ab2Ascii(buffer) {
      var str = Array.prototype.map.call(
        new Uint8Array(buffer),
        function (bit) {
          return String.fromCharCode(bit);
        }
      )  
      return str.join('');
    

猜你喜欢

转载自alex-yang-xiansoftware-com.iteye.com/blog/2419789