JavaScriptでUint8Arrayをdump
Uint8Array.prototype.dump = function() { var t = ""; for (var i = 0; i < this.length; i++) { t += String(this[i]); if (i % 4 == 3) t += " "; if (i % 16 == 15) t += "\n"; } return t; }; var a = new Uint8Array([0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,1,0,0,0,1,0,1]); a.dump();
0000 0001 0010 0011 0100 0101
雑感
いいバイナリエディタ|ビューワ教えて下さい