◐ Shell
clean mode source ↗

crypto: drop Math.pow(), use static exponentation · nodejs/node@d0cb9cb

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) {