DEP0115:crypto.prng()、crypto.pseudoRandomBytes()、crypto.rng()


【DEP0115: crypto.prng(), crypto.pseudoRandomBytes(), crypto.rng()

类型:仅文档(支持 --pending-deprecation

【Type: Documentation-only (supports --pending-deprecation)】

在最近版本的 Node.js 中,crypto.randomBytes()crypto.pseudoRandomBytes() 没有区别。后者已被弃用,同时未记录的别名 crypto.prng()crypto.rng() 也不推荐使用,建议使用 crypto.randomBytes(),并且在将来的版本中可能会被移除。

【In recent versions of Node.js, there is no difference between crypto.randomBytes() and crypto.pseudoRandomBytes(). The latter is deprecated along with the undocumented aliases crypto.prng() and crypto.rng() in favor of crypto.randomBytes() and might be removed in a future release.】