(hexstr)
| 31 | |
| 32 | // Return the binary data represented by the given hexdecimal string. |
| 33 | function unhexlify(hexstr) { |
| 34 | if (hexstr.length % 2 == 1) |
| 35 | throw new TypeError("Invalid hex string"); |
| 36 | |
| 37 | var bytes = new Uint8Array(hexstr.length / 2); |
| 38 | for (var i = 0; i < hexstr.length; i += 2) |
| 39 | bytes[i / 2] = parseInt(hexstr.substr(i, 2), 16); |
| 40 | |
| 41 | return bytes; |
| 42 | } |
| 43 | |
| 44 | function hexdump(data) { |
| 45 | if (typeof data.BYTES_PER_ELEMENT !== 'undefined') |