Files
LingChair-V0/server_src/hashlib.js
MoonLeeeaf a376ead195 chore: init
2024-05-10 21:14:50 +08:00

17 lines
454 B
JavaScript

/*
* ©2024 满月叶
* Github: MoonLeeeaf
* 哈希辅助类
*/
const crypto = require("crypto")
let apis = {
sha256: (data) => crypto.createHash("sha256").update(data).digest("base64"),
md5: (data) => crypto.createHash("md5").update(data).digest("base64"),
sha256hex: (data) => crypto.createHash("sha256").update(data).digest("hex"),
md5hex: (data) => crypto.createHash("md5").update(data).digest("hex"),
}
module.exports = apis