diff --git a/test/packer.js b/test/packer.js index 401f9c0..e5b6041 100644 --- a/test/packer.js +++ b/test/packer.js @@ -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('');