shaneMangudi / bcrypt-nodejs

Native implementation of bcrypt for NodeJS
Other
574 stars 69 forks source link

Salt in final hash result #49

Open sabrehagen opened 9 years ago

sabrehagen commented 9 years ago

Hi,

Could you please elaborate in the docs regarding the following statement please:

Though you can use your custom salt and there is no need for salts to be persisted as it will always be included in the final hash result and can be retrieved.

Thanks, we'll all benefit.

bookercodes commented 9 years ago

Hello,

I think what @shaneGirish means is:

If you do not supply a salt to the hash or hashSync functions, a salt will be generated for you. If you do decide to generate your own salt - which can be done using the genSalt or genSaltSync functions - you do not need to manually store that salt anywhere because it is embedded in the result - both the salt and hash are stored in the database, but they are stored in one field.

Make sense? :worried: