Remove .gitignore and add dist and node_modules (LFS for .exe)
Made-with: Cursor
This commit is contained in:
1 parent
1fc4db96c8
commit
048ab8b980
5819 files changed
+1357436
-2
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hashFile = void 0;
|
||||
const crypto_1 = require("crypto");
|
||||
const fs_1 = require("fs");
|
||||
function hashFile(file, algorithm = "sha512", encoding = "base64", options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const hash = (0, crypto_1.createHash)(algorithm);
|
||||
hash.on("error", reject).setEncoding(encoding);
|
||||
(0, fs_1.createReadStream)(file, { ...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */ })
|
||||
.on("error", reject)
|
||||
.on("end", () => {
|
||||
hash.end();
|
||||
resolve(hash.read());
|
||||
})
|
||||
.pipe(hash, { end: false });
|
||||
});
|
||||
}
|
||||
exports.hashFile = hashFile;
|
||||
//# sourceMappingURL=hash.js.map
|
||||
Reference in new issue
Block a user