From: Chris Duncan Date: Mon, 4 Aug 2025 18:11:42 +0000 (-0700) Subject: Simplify entropy hex regex. X-Git-Tag: v0.10.5~46^2~10 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=5684cea25f7ab30cf79aeb9324bbd60497b0c3e9;p=libnemo.git Simplify entropy hex regex. --- diff --git a/src/lib/entropy.ts b/src/lib/entropy.ts index 5d34ff6..03df287 100644 --- a/src/lib/entropy.ts +++ b/src/lib/entropy.ts @@ -90,7 +90,7 @@ export class Entropy { if (input.length % Entropy.#MOD * 2 !== 0) { throw new RangeError(`Entropy must be a multiple of ${Entropy.#MOD * 2} characters`) } - if (!/^[0-9a-fA-F]+$/i.test(input)) { + if (!/^[A-F0-9]+$/i.test(input)) { throw new RangeError('Entropy contains invalid hexadecimal characters') } this.#bytes = hex.toBytes(input)