diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/node-fallbacks/crypto.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/node-fallbacks/crypto.js b/src/node-fallbacks/crypto.js index 2ab82cc89..7b72c4ea1 100644 --- a/src/node-fallbacks/crypto.js +++ b/src/node-fallbacks/crypto.js @@ -1,4 +1,10 @@ export * from "crypto-browserify"; -const { randomUUID } = crypto; -export { randomUUID }; +// we deliberately reference crypto. directly here because we want to preserve the This binding +export var getRandomValues = (array) => { + return crypto.getRandomValues(array); +}; + +export var randomUUID = () => { + return crypto.randomUUID(); +}; |