fix hexdump function
This commit is contained in:
parent
0834ae0ad0
commit
39de466876
|
@ -23,11 +23,11 @@
|
|||
|
||||
var ab = dnsjs.write(json);
|
||||
//console.log(ab);
|
||||
var ui8 = new Uint8Array(ab);
|
||||
//console.log(ui8);
|
||||
var bytecount = 0;
|
||||
|
||||
function hexdump() {
|
||||
function hexdump(ab) {
|
||||
var ui8 = new Uint8Array(ab);
|
||||
var bytecount = 0;
|
||||
var head = ' 0 1 2 3 4 5 6 7 8 9 A B C D E F';
|
||||
var trail;
|
||||
var str = [].slice.call(ui8).map(function (i) {
|
||||
|
@ -50,14 +50,14 @@
|
|||
while (trail.length < 7) {
|
||||
trail = '0' + trail;
|
||||
}
|
||||
return head + '\n' + str + '\n' + trail
|
||||
return head + '\n' + str + '\n' + trail;
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log('DEBUG with hexdump: ');
|
||||
console.log('hexdump ' + onefile.replace(/\.[^\.]*$/, '.bin'));
|
||||
console.log('');
|
||||
console.log(hexdump(ui8));
|
||||
console.log(hexdump(ab));
|
||||
console.log('');
|
||||
|
||||
console.error('');
|
||||
|
|
Loading…
Reference in New Issue