From: Chris Duncan Date: Sat, 8 Aug 2026 09:06:45 +0000 (-0700) Subject: Revert regex to just check for hex format and maximum length, and rely on left-padded... X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=49ec86aee6c82c99bf4a13c03e23d27a95ab2395;p=libnemo.git Revert regex to just check for hex format and maximum length, and rely on left-padded byte conversion. --- diff --git a/src/lib/block/index.ts b/src/lib/block/index.ts index afa614c..04b4229 100644 --- a/src/lib/block/index.ts +++ b/src/lib/block/index.ts @@ -80,7 +80,7 @@ export class Block { if (typeof previous !== 'string') { throw new TypeError('Account frontier is unknown') } - if (!(/^[0-9A-F]{64}$/i.test(previous))) { + if (!(/^([0-9A-F]{2}){1,64}$/i.test(previous))) { throw new RangeError('Invalid frontier hash') } this.account = account