Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d0cb9cb

Browse filesBrowse files
bnoordhuistargos
authored andcommitted
crypto: drop Math.pow(), use static exponentation
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>
1 parent 2d9c3cc commit d0cb9cb
Copy full SHA for d0cb9cb

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎lib/internal/crypto/random.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/random.js
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.