From 5aa27c45f1cae6f0121e0860cd4be329ced887a6 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 20 Dec 2023 07:54:55 +0530 Subject: fix(node): add crypto.pseudoRandomBytes (#21649) --- ext/node/polyfills/crypto.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext') diff --git a/ext/node/polyfills/crypto.ts b/ext/node/polyfills/crypto.ts index 53c9fc2ea..089393222 100644 --- a/ext/node/polyfills/crypto.ts +++ b/ext/node/polyfills/crypto.ts @@ -306,6 +306,9 @@ const setFips = fipsForced ? setFipsForced : setFipsCrypto; const sign = signOneShot; const verify = verifyOneShot; +/* Deprecated in Node.js, alias of randomBytes */ +const pseudoRandomBytes = randomBytes; + export default { Certificate, checkPrime, @@ -353,6 +356,7 @@ export default { publicDecrypt, publicEncrypt, randomBytes, + pseudoRandomBytes, randomFill, randomFillSync, randomInt, @@ -485,6 +489,8 @@ export { pbkdf2Sync, privateDecrypt, privateEncrypt, + /* Deprecated in Node.js, alias of randomBytes */ + pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, -- cgit v1.2.3