mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
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:
1 parent
9ecfb109e8
commit
b51ed4c3ec
157 files changed
+397
-589
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { Buffer } from "node:buffer";
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
guestFileAnswerCeiling,
|
||||
guestFileAnswerWorkingBytes,
|
||||
} from "./AgentEnvComputer.js";
|
||||
import { sha256Hex } from "../kernel/sha256Hex.js";
|
||||
import type {
|
||||
BuildControllerAnswer,
|
||||
ControlledComputer,
|
||||
@@ -343,10 +343,7 @@ export const fetchHomeFolder = async (
|
||||
);
|
||||
for (const file of batch) {
|
||||
const content = files.get(file.path);
|
||||
const sha256 =
|
||||
content === undefined
|
||||
? undefined
|
||||
: createHash("sha256").update(content).digest("hex");
|
||||
const sha256 = content === undefined ? undefined : sha256Hex(content);
|
||||
if (
|
||||
!file.path.startsWith(`${folder}/`) ||
|
||||
content?.length !== file.size ||
|
||||
|
||||
Reference in new issue
Block a user