From 27c3fcc78c68148556594eff0805dd7b3ab21b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Fri, 2 Feb 2024 23:17:53 -0300 Subject: [PATCH] fix(rand-range): use `crypto` instead of `window.crypto` Fix "ReferenceError: window is not defined" --- src/shared/lib/rand-range.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/lib/rand-range.ts b/src/shared/lib/rand-range.ts index 9988839..de4d613 100644 --- a/src/shared/lib/rand-range.ts +++ b/src/shared/lib/rand-range.ts @@ -14,7 +14,7 @@ export function randRange(min: number, max: number) { var ar = new Uint8Array(requestBytes) while (true) { - window.crypto.getRandomValues(ar) + crypto.getRandomValues(ar) var val = 0 for (var i = 0; i < requestBytes; i++) {