javascript - 如何加速多个 crypto.randomBytes 调用
问题描述
我将构建一个经常使用 crypto.randomBytes() 的服务。据我所知,它阻塞了 I/O。有没有办法至少加快这个过程?多核或多线程可以做什么?
解决方案
这里有一些细节:crypto#randomBytes 有多随机?
假设您不使用 windowscrypto.randomBytes()
正在使用/dev/urandom
. /dev/urandom
如果它是性能瓶颈,似乎有一些替代方法: https ://serverfault.com/questions/6440/is-there-an-alternative-to-dev-urandom
也不,/dev/urandom 不会运行多核:https ://bbs.archlinux.org/viewtopic.php?id=160967
推荐阅读
- android - 如何停止在标签中延迟显示插页式广告?
- java - 如何接收短信?
- javascript - 从迭代器中获取当前值
- javascript - 从异步函数渲染反应本机孩子
- php - MySQL从一列计算整数值的总和并将结果存储在另一个表中
- java - 如何在 ROOTED 设备上录制 VOIP 通话?
- javascript - 如何在 php mysql 查询中获取 javascript 变量?
- android - 有没有办法检测安装的应用程序是否正在使用?
- wordpress - WordPress。如何在 if else 语句中使用简码?
- c++ - 是否可以在单元测试中使用 QCustomPlot?