File tree 3 files changed +223
-7
lines changed
3 files changed +223
-7
lines changed Original file line number Diff line number Diff line change 36
36
"main" : " out/node/entry.js" ,
37
37
"devDependencies" : {
38
38
"@schemastore/package" : " ^0.0.6" ,
39
+ "@types/bcrypt" : " ^5.0.0" ,
39
40
"@types/body-parser" : " ^1.19.0" ,
40
41
"@types/compression" : " ^1.7.0" ,
41
42
"@types/cookie-parser" : " ^1.4.2" ,
88
89
},
89
90
"dependencies" : {
90
91
"@coder/logger" : " 1.1.16" ,
92
+ "bcrypt" : " ^5.0.1" ,
91
93
"body-parser" : " ^1.19.0" ,
92
94
"compression" : " ^1.7.4" ,
93
95
"cookie-parser" : " ^1.4.5" ,
Original file line number Diff line number Diff line change 1
1
import * as cp from "child_process"
2
2
import * as crypto from "crypto"
3
+ import * as bcrypt from "bcrypt"
3
4
import envPaths from "env-paths"
4
5
import { promises as fs } from "fs"
5
6
import * as net from "net"
@@ -116,7 +117,7 @@ export const generatePassword = async (length = 24): Promise<string> => {
116
117
}
117
118
118
119
export const hash = ( str : string ) : string => {
119
- return crypto . createHash ( "sha256" ) . update ( str ) . digest ( "hex" )
120
+ return bcrypt . hashSync ( str , 10 )
120
121
}
121
122
122
123
const mimeTypes : { [ key : string ] : string } = {
You can’t perform that action at this time.
0 commit comments