From d0d1f743f0d7a1c73108626d0bfb93cdf7e05b68 Mon Sep 17 00:00:00 2001 From: wjaaaaaaat <04amid.foyer@icloud.com> Date: Mon, 17 Feb 2025 15:29:38 -0500 Subject: [PATCH] removing strictMode I thought it served a different purpose than it did in ./Base64.mjs --- src/core/lib/Hex.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/Hex.mjs b/src/core/lib/Hex.mjs index ce7ee3a6..806b0dd2 100644 --- a/src/core/lib/Hex.mjs +++ b/src/core/lib/Hex.mjs @@ -100,7 +100,7 @@ export function toHexFast(data) { * // returns [10,20,30] * fromHex("0a:14:1e", "Colon"); */ -export function fromHex(data, delim="Auto", byteLen=2, removeNonAlphChars=false, strictMode=false) { +export function fromHex(data, delim="Auto", byteLen=2, removeNonAlphChars=false) { if (byteLen < 1 || Math.round(byteLen) !== byteLen) throw new OperationError("Byte length must be a positive integer"); @@ -116,7 +116,7 @@ export function fromHex(data, delim="Auto", byteLen=2, removeNonAlphChars=false, const output = []; for (let i = 0; i < data.length; i++) { - if (/[^a-f\d\s]/.test(data[i]) && strictMode) + if (/[^a-f\d\s]/.test(data[i])) throw new OperationError("Hex input must only contain hex digits"); for (let j = 0; j < data[i].length; j += byteLen) { output.push(parseInt(data[i].substr(j, byteLen), 16));