Video 103: Securely Storing Password: Part 1
This commit is contained in:
@@ -13,3 +13,18 @@ app.use(taskRouter)
|
||||
app.listen(port, () => {
|
||||
console.log('Server is up on port ' + port)
|
||||
})
|
||||
|
||||
const bcrypt = require('bcryptjs')
|
||||
|
||||
const myFunction = async () => {
|
||||
const password = 'Red12345!'
|
||||
const hashedPassword = await bcrypt.hash(password, 8)
|
||||
|
||||
console.log(password)
|
||||
console.log(hashedPassword)
|
||||
|
||||
const isMatch = await bcrypt.compare('red12345!', hashedPassword)
|
||||
console.log(isMatch)
|
||||
}
|
||||
|
||||
myFunction()
|
||||
|
||||
Reference in New Issue
Block a user