const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
let node_crypto = require("node:crypto");
node_crypto = require_rolldown_runtime.__toESM(node_crypto);

//#region src/translation-alignment/fingerprintBlock.ts
const computeStringDigest = (text) => node_crypto.default.createHash("sha256").update(text).digest("hex");
const fingerprintBlock = (block, previousBlock, nextBlock) => {
	const semanticDigest = computeStringDigest(block.semanticText);
	const anchorDigest = computeStringDigest(block.anchorText);
	const compositeKey = `${semanticDigest}:${anchorDigest}`;
	const contextKey = computeStringDigest(`${computeStringDigest(previousBlock?.semanticText ?? "")}:${computeStringDigest(nextBlock?.semanticText ?? "")}`);
	return {
		...block,
		semanticDigest,
		anchorDigest,
		compositeKey,
		contextKey
	};
};

//#endregion
exports.fingerprintBlock = fingerprintBlock;
//# sourceMappingURL=fingerprintBlock.cjs.map