You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My issue is a question/suggestion: The official Node.JS documentation says that the crypto.randomBytes method can block the execution:
The crypto.randomBytes() method will not complete until there is sufficient entropy available. This should normally never take longer than a few milliseconds. The only time when generating the random bytes may conceivably block for a longer period of time is right after boot, when the whole system is still low on entropy.
You can find a question whether should we use sync or async: nodejs/help#457
I don't have any performance issue yet, but I would like to use this package in production. In my use case I expect to have a lot of call to this function so it would be better if it did not block the execution. I know that a few milliseconds as the documentation says is not a lot for a single call but in a server environment a lot of few milliseconds call can block other tasks.
I suggest that we should have an interface (eg. cryptoRandomStringAsync) which does similar things but returns a Promise. What do you think?
If you like the idea but don't have time for this I can implement it and send a PR.
Thanks
The text was updated successfully, but these errors were encountered:
First of all, your package is great, thank you!
My issue is a question/suggestion: The official Node.JS documentation says that the crypto.randomBytes method can block the execution:
You can find a question whether should we use sync or async:
nodejs/help#457
I don't have any performance issue yet, but I would like to use this package in production. In my use case I expect to have a lot of call to this function so it would be better if it did not block the execution. I know that a few milliseconds as the documentation says is not a lot for a single call but in a server environment a lot of few milliseconds call can block other tasks.
I suggest that we should have an interface (eg. cryptoRandomStringAsync) which does similar things but returns a Promise. What do you think?
If you like the idea but don't have time for this I can implement it and send a PR.
Thanks
The text was updated successfully, but these errors were encountered: