Sunday 10 April 2016

Trying to understand Bcrypt code example

I'm going through some code in the 'Express in Action' book and I'm trying to figure out why the progressCallback argument is used instead of the regular callback argument in this piece of code. noop is a no operation function. It's on page 128 for those with the book.bcrypt.genSalt(SALT_FACTOR, function(err, salt) { if (err) { return done(err) } bcrypt.hash(user.password, salt, noop, function(err, hashedPassword) { if (err) { return done(err) } user.password = hashedPassword done() }) }) })

Submitted April 11, 2016 at 04:21AM by audiodev

No comments:

Post a Comment