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 question is: Is it recommended to use the sync or the async version of crypto.randomBytes() in a web server application?
I'm guessing the answer will boil down to whether or not the sync version will block the process. I found this comment which suggests that the sync version will probably be "instant" when generating small amounts of bytes. So if I always generate, let's say 512 bytes or less, would it be best to use the sync version? Or perhaps even with a small amount of generated bytes the sync version isn't "fast enough" so it would still be better for latency/throughput to use the async version?
The text was updated successfully, but these errors were encountered:
crypto.randomBytes()
has two signatures:My question is: Is it recommended to use the sync or the async version of
crypto.randomBytes()
in a web server application?I'm guessing the answer will boil down to whether or not the sync version will block the process. I found this comment which suggests that the sync version will probably be "instant" when generating small amounts of bytes. So if I always generate, let's say 512 bytes or less, would it be best to use the sync version? Or perhaps even with a small amount of generated bytes the sync version isn't "fast enough" so it would still be better for latency/throughput to use the async version?
The text was updated successfully, but these errors were encountered: