X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Futils.ts;h=b84c4c803efe974b1dde4d8e3988465bef6d94b7;hb=98446b391031d7add0e0d7f7e310e25a014370e2;hp=6178d8f116988475eca3e3fc8ac96a9260c563b7;hpb=970b38d6f87c7d0d29498f13af934c8ff6d472f5;p=poolifier.git diff --git a/src/utils.ts b/src/utils.ts index 6178d8f1..b84c4c80 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import * as os from 'node:os' -import { getRandomValues } from 'node:crypto' +import { webcrypto } from 'node:crypto' import type { MeasurementStatisticsRequirements, WorkerChoiceStrategyOptions @@ -254,5 +254,5 @@ export const once = ( * @returns A number in the [0,1[ range */ export const secureRandom = (): number => { - return getRandomValues(new Uint32Array(1))[0] / 0x100000000 + return webcrypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000 }