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

Commit

Permalink
增加BCRYPT加密支持
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoXanSheng committed Feb 9, 2022
1 parent 6c59828 commit 58f4af2
Show file tree
Hide file tree
Showing 3 changed files with 849 additions and 1 deletion.
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

0 comments on commit 58f4af2

Please sign in to comment.