javascript array back to byte string

I'm using a wrapper atm that makes JXG's Gzip utils a bunch easier. The unzipping a base64 encoded string part works rather nicely however I want to be able to turn it back into a base64 encoded string again. I somehow can't seem to wrap my head around it however, the function which unzips does the following: unzipBase64AsArray: function(input, bytes) { bytes = bytes || 1; var dec = this.unzipBase64(input), ar = [], i, j, len; for (i = 0, len = dec.length/bytes; i < len; i++){ ar[i] = 0; for (j = bytes-1; j >= 0; --j){ ar[i] += dec.charCodeAt((i *bytes) +j)

以上就是javascript array back to byte string的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准