@zwa73/utils 1.0.290 → 1.0.291
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/UtilFileTools.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ export declare namespace UtilFT {
|
|
|
213
213
|
* @param opt.chunkSize - 抽取的块大小 默认1024
|
|
214
214
|
* @param opt.chunkCount - 抽取的块的数量 默认10
|
|
215
215
|
*/
|
|
216
|
-
function
|
|
216
|
+
function computeHash(filePath: string, opt?: {
|
|
217
217
|
/**hash算法 默认md5 */
|
|
218
218
|
algorithm?: HashAlgorithm;
|
|
219
219
|
/**抽取部分计算 默认false */
|
package/dist/UtilFileTools.js
CHANGED
|
@@ -412,7 +412,7 @@ var UtilFT;
|
|
|
412
412
|
* @param opt.chunkSize - 抽取的块大小 默认1024
|
|
413
413
|
* @param opt.chunkCount - 抽取的块的数量 默认10
|
|
414
414
|
*/
|
|
415
|
-
async function
|
|
415
|
+
async function computeHash(filePath, opt) {
|
|
416
416
|
const { algorithm = "md5", chunkSize = 1024, chunkCount = 10, sampled = false } = opt ?? {};
|
|
417
417
|
const chash = async (filePath) => new Promise((resolve, reject) => {
|
|
418
418
|
const hash = crypto_1.default.createHash(algorithm);
|
|
@@ -446,5 +446,5 @@ var UtilFT;
|
|
|
446
446
|
}
|
|
447
447
|
return hash.digest("hex");
|
|
448
448
|
}
|
|
449
|
-
UtilFT.
|
|
449
|
+
UtilFT.computeHash = computeHash;
|
|
450
450
|
})(UtilFT || (exports.UtilFT = UtilFT = {}));
|
package/dist/UtilFunctions.d.ts
CHANGED
package/dist/UtilFunctions.js
CHANGED