Skip to content

Commit

Permalink
updated async readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardWright committed Aug 22, 2018
1 parent 5dfb4ee commit ce7c404
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 also uses another thread so as not to block the event loop.

## API

Expand Down

0 comments on commit ce7c404

Please sign in to comment.