forked from tsai/budibase
10 changed files with 5571 additions and 6 deletions
@ -0,0 +1,13 @@ |
|||||
|
{ |
||||
|
"name": "@budibase/core", |
||||
|
"version": "0.0.15", |
||||
|
"lockfileVersion": 1, |
||||
|
"requires": true, |
||||
|
"dependencies": { |
||||
|
"bcryptjs": { |
||||
|
"version": "2.4.3", |
||||
|
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", |
||||
|
"integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
import bcrypt from "bcryptjs"; |
||||
|
|
||||
|
function hash(password) { |
||||
|
return bcrypt.hashSync(password, 10); |
||||
|
} |
||||
|
|
||||
|
function verify(password, hash) { |
||||
|
return bcrypt.compareSync(password, hash); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
hash, verify |
||||
|
}; |
||||
@ -1,4 +1,13 @@ |
|||||
import {hash, verify} from "argon2"; |
import bcrypt from "bcryptjs"; |
||||
|
|
||||
|
function hash(password) { |
||||
|
return bcrypt.hashSync(password, 10); |
||||
|
} |
||||
|
|
||||
|
function verify(password, hash) { |
||||
|
return bcrypt.compareSync(password, hash); |
||||
|
} |
||||
|
|
||||
|
|
||||
export default { |
export default { |
||||
hash, verify |
hash, verify |
||||
|
|||||
File diff suppressed because it is too large
Loading…
Reference in new issue