bump node minimum version requirements
[benchmarks-js.git] / benchmark-utils.mjs
index 202a9a08ac4eb42f79f975e23b0f00f03fc1d9e7..d3757b5ef619adfee8d0c3a48e93a5012b319529 100644 (file)
@@ -1,4 +1,4 @@
-import crypto from 'crypto'
+import crypto, { webcrypto } from 'crypto'
 
 /**
  * Generate a cryptographically secure random number in the [0,1[ range
@@ -9,11 +9,11 @@ export function secureRandom () {
 }
 
 /**
- *  Generate a cryptographically secure random number in the [0,1[ range
+ * Generate a cryptographically secure random number in the [0,1[ range
  * @returns
  */
 export function secureRandomWithRandomValues () {
-  return crypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000
+  return webcrypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000
 }
 
 /**