Skip to content

Commit

Permalink
node/crypto/randomInt: preserve structure
Browse files Browse the repository at this point in the history
  • Loading branch information
levex committed Apr 11, 2023
1 parent 2c40c64 commit 94d41c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/node/polyfills/internal/crypto/_randomInt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export default function randomInt(
throw new Error("Min is bigger than Max!");
}

min = Math.ceil(min);
max = Math.floor(max);
const result = ops.op_node_random_int(min, max);

if (cb) {
Expand Down

0 comments on commit 94d41c5

Please sign in to comment.