mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 13:12:26 +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,5 +1,4 @@
|
||||
import { observePythonBytecodePrefix } from "../domain/python/pythonBytecodeIdentity.js";
|
||||
import { createHash } from "node:crypto";
|
||||
import {
|
||||
MarshalReader,
|
||||
smallBitLength,
|
||||
@@ -33,6 +32,7 @@ import {
|
||||
PythonPycResourceFailure,
|
||||
} from "./PythonPyc.errors.js";
|
||||
import { pythonPycBytecodeIdentity } from "./PythonPycBytecodeEquality.js";
|
||||
import { sha256Hex } from "../kernel/sha256Hex.js";
|
||||
|
||||
const TYPE_NULL = 0x30;
|
||||
const TYPE_NONE = 0x4e;
|
||||
@@ -225,7 +225,7 @@ const sha256 = (bytes: Buffer, work: PythonPycWork): string => {
|
||||
const cached = digests.get(bytes);
|
||||
if (cached !== undefined) return cached;
|
||||
work.digestedBytes += bytes.length;
|
||||
const digest = createHash("sha256").update(bytes).digest("hex");
|
||||
const digest = sha256Hex(bytes);
|
||||
digests.set(bytes, digest);
|
||||
return digest;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user