import type { PhyFile } from "./phy"; import type { PhyReference } from "./idx"; import { sha256Jcs } from "../io/json"; /** Computes the project-local PHY reference checksum. T-12. */ export async function makePhyReference(phy: PhyFile, source = "project:phy"): Promise { return { source, checksum: await sha256Jcs(phy) }; } /** Checks whether a stored checksum matches PHY. T-12. */ export async function phyReferenceMatches(phy: PhyFile, ref: PhyReference): Promise { return ref.checksum === (await sha256Jcs(phy)); }