-import { randomBytes, randomInt, randomUUID, webcrypto } from 'node:crypto';
+import { getRandomValues, randomBytes, randomInt, randomUUID } from 'node:crypto';
import { env, nextTick } from 'node:process';
import {
* @returns A number in the [0,1[ range
*/
export const secureRandom = (): number => {
- return webcrypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000;
+ return getRandomValues(new Uint32Array(1))[0] / 0x100000000;
};
export const JSONStringifyWithMapSupport = (
-import { webcrypto } from 'node:crypto';
+import { getRandomValues } from 'node:crypto';
import chalk from 'chalk';
* @internal
*/
const secureRandom = (): number => {
- return webcrypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000;
+ return getRandomValues(new Uint32Array(1))[0] / 0x100000000;
};