Skip to content

Commit

Permalink
crypto: drop Math.pow(), use static exponentation
Browse files Browse the repository at this point in the history
PR-URL: #20816
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
bnoordhuis authored and targos committed Jun 13, 2018
1 parent 2d9c3cc commit d0cb9cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/crypto/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
const { isArrayBufferView } = require('internal/util/types');

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

function assertOffset(offset, elementSize, length) {
Expand Down

0 comments on commit d0cb9cb

Please sign in to comment.