Skip to content

crypto.pseudoRandomBytes was deprecated and now uses randomBytes under the hood #280

@silkentrance

Description

@silkentrance

Operating System

  • [ x ] all

NodeJS Version

  • [ x ] 12.x +

Tmp Version

0.2.1+

Problem

  • pseudoRandomBytes was deprecated and is no longer documented in the official API docs.
  • pseudoRandomBytes uses randomBytes under the hood

On a newly booted system, the entropy pool of the system may be empty and will not give us the amount of random bytes that we need to generate random names.

This will cause randomBytes to throw an error, or, in case of the async interface, to return an error instead.

In either case, we must compensate for this and implement our own pseudoRandomBytes function, similar to what tmp did before the introduction of crypto.

See also

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions