refactor(kernel): migrate the remaining SHA-256 hex digests to sha256Hex and move isRecord into src/kernel (#11571)

* refactor(kernel): migrate the remaining one-shot SHA-256 hex digests to sha256Hex

* refactor(kernel): move isRecord into src/kernel and replace its inline copies (#11574)

* fix(scripts): import isRecord from src/kernel in the managed manifest parser
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 20:53:36 -05:00
1 parent 9ecfb109e8
commit b51ed4c3ec
157 files changed
+397 -589

No files matched your search

@@ -1,5 +1,4 @@
import type { AsarHeaderAdmission } from "../../config/asarHeaderAdmission.js";
import { createHash } from "node:crypto";
import { isAbsolute } from "node:path";
import type { Readable } from "node:stream";
@@ -29,6 +28,7 @@ import type {
JavaScriptArtifactFileSet,
} from "../../domain/javascript/javascriptArtifactFiles.js";
import { strictUtf8Decoder } from "../../domain/strictUtf8.js";
import { sha256Hex } from "../../kernel/sha256Hex.js";
interface ExpectedFile {
readonly path: string;
@@ -381,7 +381,7 @@ const readText = async (
await input.reader.open(input.entry, context.signal),
context.signal,
);
const digest = createHash("sha256").update(bytes).digest("hex");
const digest = sha256Hex(bytes);
if (digest !== input.expected.sha256 || bytes.length !== input.expected.bytes)
throw new ArtifactReaderFailure(
"integrity",