From e61ced93d6e29256268690fbd9c05b644aad3ce7 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 19 Dec 2017 13:53:33 +0000 Subject: [PATCH] Removed dependency for Utils.js from NetBIOS.js --- src/core/operations/NetBIOS.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/operations/NetBIOS.js b/src/core/operations/NetBIOS.js index e3bbf964..f6aa501f 100644 --- a/src/core/operations/NetBIOS.js +++ b/src/core/operations/NetBIOS.js @@ -1,5 +1,3 @@ -import Utils from "../Utils.js"; - /** * NetBIOS operations. * @@ -29,14 +27,13 @@ const NetBIOS = { offset = args[0]; if (input.length <= 16) { + let len = input.length; + input.length = 16; + input.fill(32, len, 16); for (let i = 0; i < input.length; i++) { output.push((input[i] >> 4) + offset); output.push((input[i] & 0xf) + offset); } - for (let i = input.length; i < 16; i++) { - output.push(67); - output.push(65); - } } return output; @@ -59,7 +56,7 @@ const NetBIOS = { output.push((((input[i] & 0xff) - offset) << 4) | (((input[i + 1] & 0xff) - offset) & 0xf)); } - output = Utils.strToByteArray(Utils.byteArrayToChars(output).trim()); + output = output.filter(x => x !== 32); } return output;