Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

增加BCRYPT加密支持 #9

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
增加BCRYPT加密支持
  • Loading branch information
GaoXanSheng committed Feb 9, 2022
commit 58f4af2645cffd39537190a8e7d60a946b70a98c
12 changes: 12 additions & 0 deletions module/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ exports.encrypt = (str, saltlen = 8, ea) => {
case 'BASE64DE':
return encrypt_.BASE64DE(str)
break
case 'BCRYPT':
return encrypt_.BCRYPT(str)
break
default:
return str
break
Expand Down Expand Up @@ -164,4 +167,13 @@ class encrypt {
BASE64DE(str) {
return Buffer.from(str, 'base64').toString()
}
/**
* 在1.12.2 CatServer-50610c7-universal
* AuthMe-5.4.0 中测试通过
* 要加密的字符串,长度 AuthMe默认为10
*
*/
BCRYPT(str){
return bcrypt.hashSync(str, 10)
}
}
Loading