Skip to content

Commit e7c3195

Browse files
authored
Fix #39: explain the used async mechanism
This PR moves knowledge created in the issue #39 to the main documentation so that the issue can be closed.
1 parent 0646370 commit e7c3195

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ bcrypt.hash('bacon', 8, function(err, hash) {
115115
});
116116
```
117117

118+
**Note:** Under the hood, asynchronisation splits a crypto operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of [JS event loop queue](https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop), thus efficiently sharing the computational resources with the other operations in the queue.
119+
118120
**Note:** Since bcrypt.js 2.4.0, if the callback argument has been omitted when calling an asynchronous function, the function returns a Promise.
119121

120122
API

0 commit comments

Comments
 (0)