tools_batch_files 1.0.3 → 1.0.4
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/README.md +1 -1
- package/package.json +3 -2
- package/utils/index.js +15 -0
package/README.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "tools_batch_files",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
4
4
|
"description": "批处理视频工具",
|
5
5
|
"keywords": [
|
6
6
|
"utils",
|
@@ -30,6 +30,7 @@
|
|
30
30
|
"imgs",
|
31
31
|
"点我批量上传视频.bat",
|
32
32
|
"package.json",
|
33
|
-
"package-lock.json"
|
33
|
+
"package-lock.json",
|
34
|
+
"utils"
|
34
35
|
]
|
35
36
|
}
|
package/utils/index.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
const crypto = require('crypto');
|
2
|
+
|
3
|
+
function generateUniqueHash() {
|
4
|
+
// 生成一个随机的 UUID
|
5
|
+
const uuid = crypto.randomBytes(16).toString('hex');
|
6
|
+
|
7
|
+
// 使用 SHA256 算法计算哈希值
|
8
|
+
const hash = crypto.createHash('sha256').update(uuid).digest('hex');
|
9
|
+
|
10
|
+
return hash;
|
11
|
+
}
|
12
|
+
|
13
|
+
const uniqueHash = generateUniqueHash();
|
14
|
+
|
15
|
+
module.exports = generateUniqueHash;
|