mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:14:31 +00:00
refactor(sandbox): centralize sha256 helpers
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import crypto from "node:crypto";
|
||||
import type { SandboxBrowserConfig, SandboxDockerConfig, SandboxWorkspaceAccess } from "./types.js";
|
||||
import { hashTextSha256 } from "./hash.js";
|
||||
|
||||
type SandboxHashInput = {
|
||||
docker: SandboxDockerConfig;
|
||||
@@ -51,5 +51,5 @@ export function computeSandboxBrowserConfigHash(input: SandboxBrowserHashInput):
|
||||
function computeHash(input: unknown): string {
|
||||
const payload = normalizeForHash(input);
|
||||
const raw = JSON.stringify(payload);
|
||||
return crypto.createHash("sha256").update(raw).digest("hex");
|
||||
return hashTextSha256(raw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user