Issue
maybe, in the signup process,
( I using express.js, MySQL, Sequelize )
- get ID and PW at Front-end
- saving ID in DB
- hashing the pw with salt
- save hashed pw in DB
And,,,
can I use salt used before?
when some user log-in this server,
their PW will be hashing and compair with DB data.
but salt is just random..
so I wanna save salt value!
Solution
If you’re using bcrypt
const salt = bcrypt.genSaltSync(12)
// Continue whatever user saving happens here with salt
Other libraries may also have these functions, generate a salt, use it as the parameter of hashing
Answered By – MTN
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0