Operating System
NodeJS Version
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