mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-18 09:57:23 +08:00
编排分类调整
This commit is contained in:
27
plugin/lib/quickcomposer/data/hash.js
Normal file
27
plugin/lib/quickcomposer/data/hash.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const NodeForge = require("node-forge");
|
||||
const sm3 = require("sm-crypto").sm3;
|
||||
|
||||
const hash = {
|
||||
// MD5 哈希
|
||||
md5Hash: function (text) {
|
||||
return NodeForge.md.md5.create().update(text).digest().toHex();
|
||||
},
|
||||
// SHA1 哈希
|
||||
sha1Hash: function (text) {
|
||||
return NodeForge.md.sha1.create().update(text).digest().toHex();
|
||||
},
|
||||
// SHA256 哈希
|
||||
sha256Hash: function (text) {
|
||||
return NodeForge.md.sha256.create().update(text).digest().toHex();
|
||||
},
|
||||
// SHA512 哈希
|
||||
sha512Hash: function (text) {
|
||||
return NodeForge.md.sha512.create().update(text).digest().toHex();
|
||||
},
|
||||
// SM3 哈希
|
||||
sm3Hash: function (text) {
|
||||
return sm3(text);
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = hash;
|
||||
Reference in New Issue
Block a user