Skip to content

Commit

Permalink
fix(rand-range): use crypto instead of window.crypto
Browse files Browse the repository at this point in the history
Fix "ReferenceError: window is not defined"
  • Loading branch information
mateusfg7 committed Feb 3, 2024
1 parent 770b975 commit 27c3fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/lib/rand-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 27c3fcc

Please sign in to comment.