feat: add deterministic cleared project media

This commit is contained in:
2026-09-02 06:38:40 +03:00
parent eb672bd664
commit dfd56f0a48
11 changed files with 2954 additions and 0 deletions

10
scripts/lib/hash-file.mjs Normal file
View File

@@ -0,0 +1,10 @@
import { createHash } from 'node:crypto';
import { createReadStream } from 'node:fs';
export const hashFile = async (path) => new Promise((resolve, reject) => {
const digest = createHash('sha256');
const stream = createReadStream(path);
stream.on('error', reject);
stream.on('data', (chunk) => digest.update(chunk));
stream.on('end', () => resolve(digest.digest('hex')));
});