From 41c8a5aff0a95d7cb8a12d204269b568a9cb0964 Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Wed, 15 Jan 2020 22:20:47 +0000 Subject: [PATCH] fromHex can now extract 0x format --- src/core/lib/Hex.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/Hex.mjs b/src/core/lib/Hex.mjs index 0274f876..0108eabd 100644 --- a/src/core/lib/Hex.mjs +++ b/src/core/lib/Hex.mjs @@ -104,7 +104,7 @@ export function toHexFast(data) { */ export function fromHex(data, delim="Auto", byteLen=2) { if (delim !== "None") { - const delimRegex = delim === "Auto" ? /[^a-f\d]/gi : Utils.regexRep(delim); + const delimRegex = delim === "Auto" ? /[^a-f\d]|(0x)/gi : Utils.regexRep(delim); data = data.replace(delimRegex, ""); }