Files
ObsidianPad/node_modules/@electron/universal/dist/esm/sha.js
T

12 lines
398 B
JavaScript
Raw Normal View History

2026-05-31 18:44:04 +08:00
import * as fs from 'fs-extra';
import * as crypto from 'crypto';
import { pipeline } from 'stream/promises';
import { d } from './debug';
export const sha = async (filePath) => {
d('hashing', filePath);
const hash = crypto.createHash('sha256');
hash.setEncoding('hex');
await pipeline(fs.createReadStream(filePath), hash);
return hash.read();
};
//# sourceMappingURL=sha.js.map