Skip to content

Commit 24b17b0

Browse files
committed
improve crypto rand num generation
1 parent bb3c215 commit 24b17b0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/backend/src/graphql/__tests__/queries/tiles/get-table-connections.itest.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ interface TablePipeCountObj {
1616
}
1717

1818
function getRandNum() {
19-
const array = new Uint32Array(1)
20-
crypto.getRandomValues(array)
21-
return Math.floor((array[0] / (0xffffffff + 1)) * 5) + 1
19+
return crypto.randomInt(1, 6)
2220
}
2321

2422
describe('get table connections query', () => {

0 commit comments

Comments
 (0)