From 39de4668764834806304e1a72114ffc53b38fd78 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 17 Feb 2017 18:52:15 -0700 Subject: [PATCH] fix hexdump function --- test/packer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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('');