Async or Sync bcrypt function to use in node.js in order to generate hashes?

前端 未结 2 653
一生所求
一生所求 2021-01-05 05:38

I\'m currently trying to make authentication module for my project in node.js?

I\'ve already seen some examples of using bcrypt to generate hashes, i.e.

http

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-05 05:52

    Yes, you'd want to use the async version if possible so you're not tying up your node processing during the password hash. In both source code cases you reference, the code is using the synchronous version because the method it's used within is synchronous so the author had no choice but to use the synchronous version.

提交回复
热议问题