Checkpoint: current Lumen state
Some checks failed
ci / check (push) Has been cancelled

This commit is contained in:
Lumen Stage1 2026-09-23 18:58:21 -05:00
commit fcc18ddcc8
96 changed files with 8074 additions and 214 deletions

26
pipeline/hash.ts Normal file
View file

@ -0,0 +1,26 @@
/**
* SHA-256 helpers — Node crypto (pipeline build-time).
* Trace: ARCH 10.5, SPIKE-04 F-5, IMPLEMENTATION-CONTRACT.md §11
*/
import { createHash } from "node:crypto";
import { canonicalJson } from "./canonical-json.js";
export function sha256Hex(bytes: Uint8Array): string {
return createHash("sha256").update(bytes).digest("hex");
}
export function sha256HexOfString(str: string): string {
return sha256Hex(new TextEncoder().encode(str));
}
export function sha256HexOfJson(value: unknown): string {
return sha256HexOfString(canonicalJson(value));
}
export function bytesOfString(str: string): Uint8Array {
return new TextEncoder().encode(str);
}
export function bytesToString(bytes: Uint8Array): string {
return new TextDecoder().decode(bytes);
}