From d0cb9cbb356cca6a9b8c9a8032ae3c8963fd6630 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 18 May 2018 11:05:20 +0200 Subject: [PATCH] crypto: drop Math.pow(), use static exponentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/20816 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- lib/internal/crypto/random.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index b4812d606c02fd..a30f8acdf27786 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -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) {