crypto.randomBytes is not a function
I am trying to use the speakeasy package that depends on node:crypto
By the looks of it the supported crypto version does not have crypto.randomBytes() implemented
Should I implement my own or is this something that you will be supporting in the future?
2 Replies
https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues is the Web Crypto equivalent.
Crypto: getRandomValues() method - Web APIs | MDN
The Crypto.getRandomValues() method lets you get cryptographically strong random values.
The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
randomBytes is Node specific