MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / dashboardSourceStamp

Function dashboardSourceStamp

dashboard/build.shared.mjs:464–475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

462}
463
464export async function dashboardSourceStamp() {
465 const inputs = await collectDashboardSourceInputs();
466 if (!inputs.length) return null;
467 let hash = FNV_OFFSET_BASIS;
468 for (const file of inputs) {
469 hash = fnvHashBytes(hash, Buffer.from(normalizedSourcePath(file)));
470 hash = fnvHashBytes(hash, [0]);
471 hash = fnvHashBytes(hash, await fs.readFile(path.join(dashboardRoot, file)));
472 hash = fnvHashBytes(hash, [0]);
473 }
474 return hash.toString(16).padStart(16, "0");
475}
476
477export async function writeDashboardSourceStamp() {
478 const stamp = await dashboardSourceStamp();

Callers 1

Calls 4

fnvHashBytesFunction · 0.85
normalizedSourcePathFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected