add sync download

This commit is contained in:
2025-05-12 04:30:17 +08:00
parent 4aec2bc231
commit eaccbf5ada
14 changed files with 219 additions and 32 deletions

11
src/uitls/hash.ts Normal file
View File

@@ -0,0 +1,11 @@
import MD5 from 'crypto-js/md5.js';
import fs from 'node:fs';
export const getHash = (file: string) => {
const content = fs.readFileSync(file, 'utf-8');
return MD5(content).toString();
};
export const getBufferHash = (buffer: Buffer) => {
return MD5(buffer.toString()).toString();
};