Skip to content

Commit

Permalink
fix(ext/node): add crypto.getRandomValues (#23028)
Browse files Browse the repository at this point in the history
Alias for `crypto.webcrypto.getRandomValues`
  • Loading branch information
littledivy committed Mar 22, 2024
1 parent f96f167 commit eb9d473
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/node/polyfills/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ import { crypto as webcrypto } from "ext:deno_crypto/00_crypto.js";

const fipsForced = getOptionValue("--force-fips");

function getRandomValues(typedArray) {
return webcrypto.getRandomValues(typedArray);
}

function createCipheriv(
algorithm: CipherCCMTypes,
key: CipherKey,
Expand Down Expand Up @@ -332,6 +336,7 @@ export default {
diffieHellman,
DiffieHellmanGroup,
ECDH,
getRandomValues,
generateKey,
generateKeyPair,
generateKeyPairSync,
Expand Down Expand Up @@ -480,6 +485,7 @@ export {
getDiffieHellman,
getFips,
getHashes,
getRandomValues,
Hash,
hkdf,
hkdfSync,
Expand Down

0 comments on commit eb9d473

Please sign in to comment.