feat: publish Regex Tools 0.1.0

This commit is contained in:
2026-07-24 18:04:21 +02:00
commit 873b9b218d
136 changed files with 24212 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { createHash } from "node:crypto";
export function sha256(data) {
return createHash("sha256").update(data).digest("hex");
}
export function checksumLine(digest, fileName) {
if (!/^[a-f0-9]{64}$/u.test(digest) || /[\/\r\n]/u.test(fileName)) {
throw new Error("Invalid checksum output");
}
return `${digest} ${fileName}\n`;
}