M
M
Meyl_ON2021-07-30 18:15:59
Node.js
Meyl_ON, 2021-07-30 18:15:59

How to hash passwords in Node.js?

I am considering hashing with crypto.scrypt() and through the bcryptjs library . Which one to use? How to store salt for scrypt? Or are there better options for hashing? Personally, I'm leaning towards using scrypt, but I'm not sure.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2021-07-30
@notiv-nt

bcrypt of course
the salt doesn't need to be saved

const salt = await bcrypt.genSalt(10);
const password = await bcrypt.hash('qwerty', salt);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question