// engine/frontmatter-sha/compute-sha.ts — SPEC-723: SHA-256 of frozen frontmatter fields
import { createHash } from 'node:crypto';
import { canonicalizeFrozenFields } from './canonicalize.js';
/**
 * Compute a SHA-256 hex digest of the canonical frozen-field representation.
 *
 * The hash is deterministic: identical frozen-field values always produce the
 * same hash, and changes to non-frozen fields (title, tags, etc.) do NOT affect it.
 */
export function computeFrontmatterSha(metadata) {
    const canonical = canonicalizeFrozenFields(metadata);
    return createHash('sha256').update(canonical, 'utf8').digest('hex');
}
//# sourceMappingURL=compute-sha.js.map