Skip to content

Commit

Permalink
Merge pull request #481 from RichardWright/asyncReadMe
Browse files Browse the repository at this point in the history
updated async readme
  • Loading branch information
ncb000gt committed Aug 22, 2018
2 parents 5dfb4ee + 2e86dd7 commit d32a1a6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -213,8 +213,7 @@ In general, don't use the normal JavaScript string comparison functions to compa
cryptographic keys, or cryptographic hashes if they are relevant to security.

### Why is async mode recommended over sync mode?

If you are using bcrypt on a simple script, using the sync mode is perfectly fine. However, if you are using bcrypt on a server, the async mode is recommended. This is because the hashing done by bcrypt is CPU intensive, so the sync version will block the event loop and prevent your application from servicing any other inbound requests or events.
If you are using bcrypt on a simple script, using the sync mode is perfectly fine. However, if you are using bcrypt on a server, the async mode is recommended. This is because the hashing done by bcrypt is CPU intensive, so the sync version will block the event loop and prevent your application from servicing any other inbound requests or events. The async version uses a thread pool which does not block the main event loop.

## API

Expand Down

0 comments on commit d32a1a6

Please sign in to comment.