Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
-import crypto from 'crypto'
+import crypto, { webcrypto } from 'crypto'
/**
* 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 () {
* @returns
*/
export function secureRandomWithRandomValues () {
- return crypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000
+ return webcrypto.getRandomValues(new Uint32Array(1))[0] / 0x100000000