From 3d78872d15cdf25c7d6f8cedcb35d4adc112a68a Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Mon, 24 Nov 2025 23:28:41 +0000 Subject: [PATCH 1/2] Replace `parseInt` with manual octal decoding --- src/tarInput.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tarInput.ts b/src/tarInput.ts index ffd5a56..b878e3d 100644 --- a/src/tarInput.ts +++ b/src/tarInput.ts @@ -146,8 +146,9 @@ function decodeOctal(bytes: Uint8Array, from: number, to: number): number { } else { idx = from; while (idx < to && (bytes[idx] === 32 || bytes[idx] === 0)) idx++; - if (end !== idx) val = parseInt(decodeString(bytes, idx, to), 8); - return val == val ? val || 0 : 0; + while (idx < to && bytes[idx] >= 48 && bytes[idx] <= 55) + val = val * 8 + (bytes[idx++] - 48); + return val; } } From 317a23c52a4090befcc1fa8330aef8ad085e9ffe Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Mon, 24 Nov 2025 23:36:34 +0000 Subject: [PATCH 2/2] Add changeset --- .changeset/green-snakes-try.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/green-snakes-try.md diff --git a/.changeset/green-snakes-try.md b/.changeset/green-snakes-try.md new file mode 100644 index 0000000..083afa8 --- /dev/null +++ b/.changeset/green-snakes-try.md @@ -0,0 +1,5 @@ +--- +'multitars': patch +--- + +Replace `parseInt(val, 8)` for octal parsing with manual parsing (hotpath)