import { createHash } from "crypto";
export function sha256(content) {
    return createHash("sha256").update(content, "utf-8").digest("hex");
}
export function simpleDiff(oldText, newText) {
    const oldLines = oldText.split("\n");
    const newLines = newText.split("\n");
    const result = [];
    const maxLen = Math.max(oldLines.length, newLines.length);
    for (let i = 0; i < maxLen; i++) {
        const oldLine = oldLines[i] ?? "";
        const newLine = newLines[i] ?? "";
        if (oldLine !== newLine) {
            result.push(`-${oldLine}`);
            result.push(`+${newLine}`);
        }
        else {
            result.push(` ${oldLine}`);
        }
    }
    return result.join("\n");
}
