Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-79-npm / bcrypt / bcrypt.js
347 bytesRaw
1 | ; |
2 | |
3 | var bcrypt = require('bcrypt'); |
4 | var saltRounds = 10; |
5 | var myPlaintextPassword = 'P4$$w0rD'; |
6 | bcrypt.genSalt(saltRounds, function (error, salt) { |
7 | if (error) return; |
8 | bcrypt.hash(myPlaintextPassword, salt, function (error2, hash) { |
9 | if (error2) return; |
10 | if (typeof hash === 'string') { |
11 | console.log('ok'); |
12 | } |
13 | }); |
14 | }); |
15 |
Built with git-ssb-web