Skip to content

Commit d0cb9cb

Browse files
bnoordhuistargos
authored andcommitted
crypto: drop Math.pow(), use static exponentation
PR-URL: #20816 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 2d9c3cc commit d0cb9cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/crypto/random.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {
1111
const { isArrayBufferView } = require('internal/util/types');
1212

1313
const { kMaxLength } = require('buffer');
14-
const kMaxUint32 = Math.pow(2, 32) - 1;
14+
const kMaxUint32 = 2 ** 32 - 1;
1515
const kMaxPossibleLength = Math.min(kMaxLength, kMaxUint32);
1616

1717
function assertOffset(offset, elementSize, length) {

0 commit comments

Comments
 (0)