@polkadot/util
Advanced tools
Comparing version 10.2.6 to 10.3.1
@@ -12,4 +12,59 @@ /** | ||
/** | ||
* @name _2n | ||
* @summary BigInt constant for 2. | ||
*/ | ||
export declare const _2n: bigint; | ||
/** | ||
* @name _3n | ||
* @summary BigInt constant for 3. | ||
*/ | ||
export declare const _3n: bigint; | ||
/** | ||
* @name _4n | ||
* @summary BigInt constant for 4. | ||
*/ | ||
export declare const _4n: bigint; | ||
/** | ||
* @name _5n | ||
* @summary BigInt constant for 5. | ||
*/ | ||
export declare const _5n: bigint; | ||
/** | ||
* @name _6n | ||
* @summary BigInt constant for 6. | ||
*/ | ||
export declare const _6n: bigint; | ||
/** | ||
* @name _7n | ||
* @summary BigInt constant for 7. | ||
*/ | ||
export declare const _7n: bigint; | ||
/** | ||
* @name _8n | ||
* @summary BigInt constant for 8. | ||
*/ | ||
export declare const _8n: bigint; | ||
/** | ||
* @name _9n | ||
* @summary BigInt constant for 9. | ||
*/ | ||
export declare const _9n: bigint; | ||
/** | ||
* @name _10n | ||
* @summary BigInt constant for 10. | ||
*/ | ||
export declare const _10n: bigint; | ||
/** | ||
* @name _100n | ||
* @summary BigInt constant for 100. | ||
*/ | ||
export declare const _100n: bigint; | ||
/** | ||
* @name _1000n | ||
* @summary BigInt constant for 1000. | ||
*/ | ||
export declare const _1000n: bigint; | ||
/** | ||
* @name _1Mn | ||
* @summary BigInt constant for 1,000,000. | ||
* @summary BigInt constant for 1,000,000 (million). | ||
*/ | ||
@@ -19,3 +74,3 @@ export declare const _1Mn: bigint; | ||
* @name _1Bn | ||
* @summary BigInt constant for 1,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000 (billion). | ||
*/ | ||
@@ -25,3 +80,3 @@ export declare const _1Bn: bigint; | ||
* @name _1Qn | ||
* @summary BigInt constant for 1,000,000,000,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000,000,000,000 (quitillion). | ||
*/ | ||
@@ -34,1 +89,6 @@ export declare const _1Qn: bigint; | ||
export declare const _2pow53n: bigint; | ||
/** | ||
* @name _sqrt2pow53n | ||
* @summary BigInt constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
export declare const _sqrt2pow53n: bigint; |
@@ -10,3 +10,3 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
*/ | ||
export const _0n = BigInt(0); | ||
export const _0n = /*#__PURE__*/BigInt(0); | ||
@@ -17,19 +17,85 @@ /** | ||
*/ | ||
export const _1n = BigInt(1); | ||
export const _1n = /*#__PURE__*/BigInt(1); | ||
/** | ||
* @name _2n | ||
* @summary BigInt constant for 2. | ||
*/ | ||
export const _2n = /*#__PURE__*/BigInt(2); | ||
/** | ||
* @name _3n | ||
* @summary BigInt constant for 3. | ||
*/ | ||
export const _3n = /*#__PURE__*/BigInt(3); | ||
/** | ||
* @name _4n | ||
* @summary BigInt constant for 4. | ||
*/ | ||
export const _4n = /*#__PURE__*/BigInt(4); | ||
/** | ||
* @name _5n | ||
* @summary BigInt constant for 5. | ||
*/ | ||
export const _5n = /*#__PURE__*/BigInt(5); | ||
/** | ||
* @name _6n | ||
* @summary BigInt constant for 6. | ||
*/ | ||
export const _6n = /*#__PURE__*/BigInt(6); | ||
/** | ||
* @name _7n | ||
* @summary BigInt constant for 7. | ||
*/ | ||
export const _7n = /*#__PURE__*/BigInt(7); | ||
/** | ||
* @name _8n | ||
* @summary BigInt constant for 8. | ||
*/ | ||
export const _8n = /*#__PURE__*/BigInt(8); | ||
/** | ||
* @name _9n | ||
* @summary BigInt constant for 9. | ||
*/ | ||
export const _9n = /*#__PURE__*/BigInt(9); | ||
/** | ||
* @name _10n | ||
* @summary BigInt constant for 10. | ||
*/ | ||
export const _10n = /*#__PURE__*/BigInt(10); | ||
/** | ||
* @name _100n | ||
* @summary BigInt constant for 100. | ||
*/ | ||
export const _100n = /*#__PURE__*/BigInt(100); | ||
/** | ||
* @name _1000n | ||
* @summary BigInt constant for 1000. | ||
*/ | ||
export const _1000n = /*#__PURE__*/BigInt(1000); | ||
/** | ||
* @name _1Mn | ||
* @summary BigInt constant for 1,000,000. | ||
* @summary BigInt constant for 1,000,000 (million). | ||
*/ | ||
export const _1Mn = BigInt(1000000); | ||
export const _1Mn = /*#__PURE__*/BigInt(1000000); | ||
/** | ||
* @name _1Bn | ||
* @summary BigInt constant for 1,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000 (billion). | ||
*/ | ||
export const _1Bn = BigInt(1000000000); | ||
export const _1Bn = /*#__PURE__*/BigInt(1000000000); | ||
/** | ||
* @name _1Qn | ||
* @summary BigInt constant for 1,000,000,000,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000,000,000,000 (quitillion). | ||
*/ | ||
@@ -42,2 +108,8 @@ export const _1Qn = _1Bn * _1Bn; | ||
*/ | ||
export const _2pow53n = BigInt(Number.MAX_SAFE_INTEGER); | ||
export const _2pow53n = /*#__PURE__*/BigInt(Number.MAX_SAFE_INTEGER); | ||
/** | ||
* @name _sqrt2pow53n | ||
* @summary BigInt constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
export const _sqrt2pow53n = /*#__PURE__*/BigInt(94906265); |
/// <reference types="bn.js" /> | ||
import type { BN } from '../bn'; | ||
import type { ToBigInt, ToBn } from '../types'; | ||
/** @internal */ | ||
export declare const SQRT_MAX_SAFE_INTEGER: bigint; | ||
/** | ||
@@ -7,0 +5,0 @@ * @name nSqrt |
@@ -5,8 +5,5 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
import { BigInt } from '@polkadot/x-bigint'; | ||
import { _0n, _1n, _2pow53n } from "./consts.js"; | ||
import { _0n, _1n, _2pow53n, _sqrt2pow53n } from "./consts.js"; | ||
import { nToBigInt } from "./toBigInt.js"; | ||
/** @internal */ | ||
export const SQRT_MAX_SAFE_INTEGER = BigInt(94906265); | ||
/** | ||
@@ -31,3 +28,3 @@ * @name nSqrt | ||
// output will be larger than this, we expect this to be a safe start | ||
let x0 = SQRT_MAX_SAFE_INTEGER; | ||
let x0 = _sqrt2pow53n; | ||
while (true) { | ||
@@ -34,0 +31,0 @@ const x1 = n / x0 + x0 >> _1n; |
@@ -88,1 +88,6 @@ /// <reference types="bn.js" /> | ||
export declare const BN_MAX_INTEGER: BN; | ||
/** | ||
* @name BN_SQRT_MAX_INTEGER | ||
* @summary BN constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
export declare const BN_SQRT_MAX_INTEGER: BN; |
@@ -10,3 +10,3 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
*/ | ||
export const BN_ZERO = new BN(0); | ||
export const BN_ZERO = /*#__PURE__*/new BN(0); | ||
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
export const BN_ONE = new BN(1); | ||
export const BN_ONE = /*#__PURE__*/new BN(1); | ||
@@ -24,3 +24,3 @@ /** | ||
*/ | ||
export const BN_TWO = new BN(2); | ||
export const BN_TWO = /*#__PURE__*/new BN(2); | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
export const BN_THREE = new BN(3); | ||
export const BN_THREE = /*#__PURE__*/new BN(3); | ||
@@ -38,3 +38,3 @@ /** | ||
*/ | ||
export const BN_FOUR = new BN(4); | ||
export const BN_FOUR = /*#__PURE__*/new BN(4); | ||
@@ -45,3 +45,3 @@ /** | ||
*/ | ||
export const BN_FIVE = new BN(5); | ||
export const BN_FIVE = /*#__PURE__*/new BN(5); | ||
@@ -52,3 +52,3 @@ /** | ||
*/ | ||
export const BN_SIX = new BN(6); | ||
export const BN_SIX = /*#__PURE__*/new BN(6); | ||
@@ -59,3 +59,3 @@ /** | ||
*/ | ||
export const BN_SEVEN = new BN(7); | ||
export const BN_SEVEN = /*#__PURE__*/new BN(7); | ||
@@ -66,3 +66,3 @@ /** | ||
*/ | ||
export const BN_EIGHT = new BN(8); | ||
export const BN_EIGHT = /*#__PURE__*/new BN(8); | ||
@@ -73,3 +73,3 @@ /** | ||
*/ | ||
export const BN_NINE = new BN(9); | ||
export const BN_NINE = /*#__PURE__*/new BN(9); | ||
@@ -80,3 +80,3 @@ /** | ||
*/ | ||
export const BN_TEN = new BN(10); | ||
export const BN_TEN = /*#__PURE__*/new BN(10); | ||
@@ -87,3 +87,3 @@ /** | ||
*/ | ||
export const BN_HUNDRED = new BN(100); | ||
export const BN_HUNDRED = /*#__PURE__*/new BN(100); | ||
@@ -94,3 +94,3 @@ /** | ||
*/ | ||
export const BN_THOUSAND = new BN(1000); | ||
export const BN_THOUSAND = /*#__PURE__*/new BN(1000); | ||
@@ -101,3 +101,3 @@ /** | ||
*/ | ||
export const BN_MILLION = new BN(1000000); | ||
export const BN_MILLION = /*#__PURE__*/new BN(1000000); | ||
@@ -108,3 +108,3 @@ /** | ||
*/ | ||
export const BN_BILLION = new BN(1000000000); | ||
export const BN_BILLION = /*#__PURE__*/new BN(1000000000); | ||
@@ -121,2 +121,8 @@ /** | ||
*/ | ||
export const BN_MAX_INTEGER = new BN(Number.MAX_SAFE_INTEGER); | ||
export const BN_MAX_INTEGER = /*#__PURE__*/new BN(Number.MAX_SAFE_INTEGER); | ||
/** | ||
* @name BN_SQRT_MAX_INTEGER | ||
* @summary BN constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
export const BN_SQRT_MAX_INTEGER = /*#__PURE__*/new BN(94906265); |
/// <reference types="bn.js" /> | ||
import type { ToBn } from '../types'; | ||
import { BN } from './bn'; | ||
/** @internal */ | ||
export declare const SQRT_MAX_SAFE_INTEGER: BN; | ||
/** | ||
@@ -7,0 +5,0 @@ * @name bnSqrt |
@@ -5,8 +5,5 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
import { BN } from "./bn.js"; | ||
import { BN_MAX_INTEGER, BN_ONE } from "./consts.js"; | ||
import { BN_MAX_INTEGER, BN_ONE, BN_SQRT_MAX_INTEGER } from "./consts.js"; | ||
import { bnToBn } from "./toBn.js"; | ||
/** @internal */ | ||
export const SQRT_MAX_SAFE_INTEGER = new BN(94906265); | ||
/** | ||
@@ -40,3 +37,3 @@ * @name bnSqrt | ||
// output will be larger than this, we expect this to be a safe start | ||
let x0 = SQRT_MAX_SAFE_INTEGER.clone(); | ||
let x0 = BN_SQRT_MAX_INTEGER.clone(); | ||
while (true) { | ||
@@ -43,0 +40,0 @@ const x1 = n.div(x0).iadd(x0).ishrn(1); |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports._2pow53n = exports._1n = exports._1Qn = exports._1Mn = exports._1Bn = exports._0n = void 0; | ||
exports._sqrt2pow53n = exports._9n = exports._8n = exports._7n = exports._6n = exports._5n = exports._4n = exports._3n = exports._2pow53n = exports._2n = exports._1n = exports._1Qn = exports._1Mn = exports._1Bn = exports._10n = exports._100n = exports._1000n = exports._0n = void 0; | ||
var _xBigint = require("@polkadot/x-bigint"); | ||
@@ -16,3 +16,3 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
*/ | ||
const _0n = (0, _xBigint.BigInt)(0); | ||
const _0n = /*#__PURE__*/(0, _xBigint.BigInt)(0); | ||
@@ -24,21 +24,98 @@ /** | ||
exports._0n = _0n; | ||
const _1n = (0, _xBigint.BigInt)(1); | ||
const _1n = /*#__PURE__*/(0, _xBigint.BigInt)(1); | ||
/** | ||
* @name _1Mn | ||
* @summary BigInt constant for 1,000,000. | ||
* @name _2n | ||
* @summary BigInt constant for 2. | ||
*/ | ||
exports._1n = _1n; | ||
const _1Mn = (0, _xBigint.BigInt)(1000000); | ||
const _2n = /*#__PURE__*/(0, _xBigint.BigInt)(2); | ||
/** | ||
* @name _3n | ||
* @summary BigInt constant for 3. | ||
*/ | ||
exports._2n = _2n; | ||
const _3n = /*#__PURE__*/(0, _xBigint.BigInt)(3); | ||
/** | ||
* @name _4n | ||
* @summary BigInt constant for 4. | ||
*/ | ||
exports._3n = _3n; | ||
const _4n = /*#__PURE__*/(0, _xBigint.BigInt)(4); | ||
/** | ||
* @name _5n | ||
* @summary BigInt constant for 5. | ||
*/ | ||
exports._4n = _4n; | ||
const _5n = /*#__PURE__*/(0, _xBigint.BigInt)(5); | ||
/** | ||
* @name _6n | ||
* @summary BigInt constant for 6. | ||
*/ | ||
exports._5n = _5n; | ||
const _6n = /*#__PURE__*/(0, _xBigint.BigInt)(6); | ||
/** | ||
* @name _7n | ||
* @summary BigInt constant for 7. | ||
*/ | ||
exports._6n = _6n; | ||
const _7n = /*#__PURE__*/(0, _xBigint.BigInt)(7); | ||
/** | ||
* @name _8n | ||
* @summary BigInt constant for 8. | ||
*/ | ||
exports._7n = _7n; | ||
const _8n = /*#__PURE__*/(0, _xBigint.BigInt)(8); | ||
/** | ||
* @name _9n | ||
* @summary BigInt constant for 9. | ||
*/ | ||
exports._8n = _8n; | ||
const _9n = /*#__PURE__*/(0, _xBigint.BigInt)(9); | ||
/** | ||
* @name _10n | ||
* @summary BigInt constant for 10. | ||
*/ | ||
exports._9n = _9n; | ||
const _10n = /*#__PURE__*/(0, _xBigint.BigInt)(10); | ||
/** | ||
* @name _100n | ||
* @summary BigInt constant for 100. | ||
*/ | ||
exports._10n = _10n; | ||
const _100n = /*#__PURE__*/(0, _xBigint.BigInt)(100); | ||
/** | ||
* @name _1000n | ||
* @summary BigInt constant for 1000. | ||
*/ | ||
exports._100n = _100n; | ||
const _1000n = /*#__PURE__*/(0, _xBigint.BigInt)(1000); | ||
/** | ||
* @name _1Mn | ||
* @summary BigInt constant for 1,000,000 (million). | ||
*/ | ||
exports._1000n = _1000n; | ||
const _1Mn = /*#__PURE__*/(0, _xBigint.BigInt)(1000000); | ||
/** | ||
* @name _1Bn | ||
* @summary BigInt constant for 1,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000 (billion). | ||
*/ | ||
exports._1Mn = _1Mn; | ||
const _1Bn = (0, _xBigint.BigInt)(1000000000); | ||
const _1Bn = /*#__PURE__*/(0, _xBigint.BigInt)(1000000000); | ||
/** | ||
* @name _1Qn | ||
* @summary BigInt constant for 1,000,000,000,000,000,000. | ||
* @summary BigInt constant for 1,000,000,000,000,000,000 (quitillion). | ||
*/ | ||
@@ -53,3 +130,10 @@ exports._1Bn = _1Bn; | ||
exports._1Qn = _1Qn; | ||
const _2pow53n = (0, _xBigint.BigInt)(Number.MAX_SAFE_INTEGER); | ||
exports._2pow53n = _2pow53n; | ||
const _2pow53n = /*#__PURE__*/(0, _xBigint.BigInt)(Number.MAX_SAFE_INTEGER); | ||
/** | ||
* @name _sqrt2pow53n | ||
* @summary BigInt constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
exports._2pow53n = _2pow53n; | ||
const _sqrt2pow53n = /*#__PURE__*/(0, _xBigint.BigInt)(94906265); | ||
exports._sqrt2pow53n = _sqrt2pow53n; |
@@ -6,3 +6,2 @@ "use strict"; | ||
}); | ||
exports.SQRT_MAX_SAFE_INTEGER = void 0; | ||
exports.nSqrt = nSqrt; | ||
@@ -15,5 +14,2 @@ var _xBigint = require("@polkadot/x-bigint"); | ||
/** @internal */ | ||
const SQRT_MAX_SAFE_INTEGER = (0, _xBigint.BigInt)(94906265); | ||
/** | ||
@@ -23,3 +19,2 @@ * @name nSqrt | ||
*/ | ||
exports.SQRT_MAX_SAFE_INTEGER = SQRT_MAX_SAFE_INTEGER; | ||
function nSqrt(value) { | ||
@@ -40,3 +35,3 @@ const n = (0, _toBigInt.nToBigInt)(value); | ||
// output will be larger than this, we expect this to be a safe start | ||
let x0 = SQRT_MAX_SAFE_INTEGER; | ||
let x0 = _consts._sqrt2pow53n; | ||
while (true) { | ||
@@ -43,0 +38,0 @@ const x1 = n / x0 + x0 >> _consts._1n; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.BN_ZERO = exports.BN_TWO = exports.BN_THREE = exports.BN_THOUSAND = exports.BN_TEN = exports.BN_SIX = exports.BN_SEVEN = exports.BN_QUINTILL = exports.BN_ONE = exports.BN_NINE = exports.BN_MILLION = exports.BN_MAX_INTEGER = exports.BN_HUNDRED = exports.BN_FOUR = exports.BN_FIVE = exports.BN_EIGHT = exports.BN_BILLION = void 0; | ||
exports.BN_ZERO = exports.BN_TWO = exports.BN_THREE = exports.BN_THOUSAND = exports.BN_TEN = exports.BN_SQRT_MAX_INTEGER = exports.BN_SIX = exports.BN_SEVEN = exports.BN_QUINTILL = exports.BN_ONE = exports.BN_NINE = exports.BN_MILLION = exports.BN_MAX_INTEGER = exports.BN_HUNDRED = exports.BN_FOUR = exports.BN_FIVE = exports.BN_EIGHT = exports.BN_BILLION = void 0; | ||
var _bn = require("./bn"); | ||
@@ -16,3 +16,3 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
*/ | ||
const BN_ZERO = new _bn.BN(0); | ||
const BN_ZERO = /*#__PURE__*/new _bn.BN(0); | ||
@@ -24,3 +24,3 @@ /** | ||
exports.BN_ZERO = BN_ZERO; | ||
const BN_ONE = new _bn.BN(1); | ||
const BN_ONE = /*#__PURE__*/new _bn.BN(1); | ||
@@ -32,3 +32,3 @@ /** | ||
exports.BN_ONE = BN_ONE; | ||
const BN_TWO = new _bn.BN(2); | ||
const BN_TWO = /*#__PURE__*/new _bn.BN(2); | ||
@@ -40,3 +40,3 @@ /** | ||
exports.BN_TWO = BN_TWO; | ||
const BN_THREE = new _bn.BN(3); | ||
const BN_THREE = /*#__PURE__*/new _bn.BN(3); | ||
@@ -48,3 +48,3 @@ /** | ||
exports.BN_THREE = BN_THREE; | ||
const BN_FOUR = new _bn.BN(4); | ||
const BN_FOUR = /*#__PURE__*/new _bn.BN(4); | ||
@@ -56,3 +56,3 @@ /** | ||
exports.BN_FOUR = BN_FOUR; | ||
const BN_FIVE = new _bn.BN(5); | ||
const BN_FIVE = /*#__PURE__*/new _bn.BN(5); | ||
@@ -64,3 +64,3 @@ /** | ||
exports.BN_FIVE = BN_FIVE; | ||
const BN_SIX = new _bn.BN(6); | ||
const BN_SIX = /*#__PURE__*/new _bn.BN(6); | ||
@@ -72,3 +72,3 @@ /** | ||
exports.BN_SIX = BN_SIX; | ||
const BN_SEVEN = new _bn.BN(7); | ||
const BN_SEVEN = /*#__PURE__*/new _bn.BN(7); | ||
@@ -80,3 +80,3 @@ /** | ||
exports.BN_SEVEN = BN_SEVEN; | ||
const BN_EIGHT = new _bn.BN(8); | ||
const BN_EIGHT = /*#__PURE__*/new _bn.BN(8); | ||
@@ -88,3 +88,3 @@ /** | ||
exports.BN_EIGHT = BN_EIGHT; | ||
const BN_NINE = new _bn.BN(9); | ||
const BN_NINE = /*#__PURE__*/new _bn.BN(9); | ||
@@ -96,3 +96,3 @@ /** | ||
exports.BN_NINE = BN_NINE; | ||
const BN_TEN = new _bn.BN(10); | ||
const BN_TEN = /*#__PURE__*/new _bn.BN(10); | ||
@@ -104,3 +104,3 @@ /** | ||
exports.BN_TEN = BN_TEN; | ||
const BN_HUNDRED = new _bn.BN(100); | ||
const BN_HUNDRED = /*#__PURE__*/new _bn.BN(100); | ||
@@ -112,3 +112,3 @@ /** | ||
exports.BN_HUNDRED = BN_HUNDRED; | ||
const BN_THOUSAND = new _bn.BN(1000); | ||
const BN_THOUSAND = /*#__PURE__*/new _bn.BN(1000); | ||
@@ -120,3 +120,3 @@ /** | ||
exports.BN_THOUSAND = BN_THOUSAND; | ||
const BN_MILLION = new _bn.BN(1000000); | ||
const BN_MILLION = /*#__PURE__*/new _bn.BN(1000000); | ||
@@ -128,3 +128,3 @@ /** | ||
exports.BN_MILLION = BN_MILLION; | ||
const BN_BILLION = new _bn.BN(1000000000); | ||
const BN_BILLION = /*#__PURE__*/new _bn.BN(1000000000); | ||
@@ -143,3 +143,10 @@ /** | ||
exports.BN_QUINTILL = BN_QUINTILL; | ||
const BN_MAX_INTEGER = new _bn.BN(Number.MAX_SAFE_INTEGER); | ||
exports.BN_MAX_INTEGER = BN_MAX_INTEGER; | ||
const BN_MAX_INTEGER = /*#__PURE__*/new _bn.BN(Number.MAX_SAFE_INTEGER); | ||
/** | ||
* @name BN_SQRT_MAX_INTEGER | ||
* @summary BN constant for Math.sqrt(MAX_SAFE_INTEGER) | ||
*/ | ||
exports.BN_MAX_INTEGER = BN_MAX_INTEGER; | ||
const BN_SQRT_MAX_INTEGER = /*#__PURE__*/new _bn.BN(94906265); | ||
exports.BN_SQRT_MAX_INTEGER = BN_SQRT_MAX_INTEGER; |
@@ -6,3 +6,2 @@ "use strict"; | ||
}); | ||
exports.SQRT_MAX_SAFE_INTEGER = void 0; | ||
exports.bnSqrt = bnSqrt; | ||
@@ -15,5 +14,2 @@ var _bn = require("./bn"); | ||
/** @internal */ | ||
const SQRT_MAX_SAFE_INTEGER = new _bn.BN(94906265); | ||
/** | ||
@@ -32,3 +28,2 @@ * @name bnSqrt | ||
*/ | ||
exports.SQRT_MAX_SAFE_INTEGER = SQRT_MAX_SAFE_INTEGER; | ||
function bnSqrt(value) { | ||
@@ -49,3 +44,3 @@ const n = (0, _toBn.bnToBn)(value); | ||
// output will be larger than this, we expect this to be a safe start | ||
let x0 = SQRT_MAX_SAFE_INTEGER.clone(); | ||
let x0 = _consts.BN_SQRT_MAX_INTEGER.clone(); | ||
while (true) { | ||
@@ -52,0 +47,0 @@ const x1 = n.div(x0).iadd(x0).ishrn(1); |
@@ -11,4 +11,4 @@ "use strict"; | ||
const CHR = '0123456789abcdef'; | ||
const U8 = new Array(256); | ||
const U16 = new Array(256 * 256); | ||
const U8 = new Uint8Array(256); | ||
const U16 = new Uint8Array(256 * 256); | ||
for (let i = 0; i < CHR.length; i++) { | ||
@@ -15,0 +15,0 @@ U8[CHR[i].charCodeAt(0) | 0] = i | 0; |
@@ -16,4 +16,4 @@ "use strict"; | ||
type: 'cjs', | ||
version: '10.2.6' | ||
version: '10.3.1' | ||
}; | ||
exports.packageInfo = packageInfo; |
@@ -5,4 +5,4 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
const CHR = '0123456789abcdef'; | ||
const U8 = new Array(256); | ||
const U16 = new Array(256 * 256); | ||
const U8 = new Uint8Array(256); | ||
const U16 = new Uint8Array(256 * 256); | ||
for (let i = 0; i < CHR.length; i++) { | ||
@@ -9,0 +9,0 @@ U8[CHR[i].charCodeAt(0) | 0] = i | 0; |
@@ -23,3 +23,3 @@ { | ||
"type": "module", | ||
"version": "10.2.6", | ||
"version": "10.3.1", | ||
"main": "./cjs/index.js", | ||
@@ -722,7 +722,7 @@ "module": "./index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.7", | ||
"@polkadot/x-bigint": "10.2.6", | ||
"@polkadot/x-global": "10.2.6", | ||
"@polkadot/x-textdecoder": "10.2.6", | ||
"@polkadot/x-textencoder": "10.2.6", | ||
"@babel/runtime": "^7.20.13", | ||
"@polkadot/x-bigint": "10.3.1", | ||
"@polkadot/x-global": "10.3.1", | ||
"@polkadot/x-textdecoder": "10.3.1", | ||
"@polkadot/x-textencoder": "10.3.1", | ||
"@types/bn.js": "^5.1.1", | ||
@@ -729,0 +729,0 @@ "bn.js": "^5.2.1" |
@@ -10,3 +10,3 @@ // Copyright 2017-2023 @polkadot/util authors & contributors | ||
type: 'esm', | ||
version: '10.2.6' | ||
version: '10.3.1' | ||
}; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
537111
152006
15522
+ Added@polkadot/x-bigint@10.3.1(transitive)
+ Added@polkadot/x-global@10.3.1(transitive)
+ Added@polkadot/x-textdecoder@10.3.1(transitive)
+ Added@polkadot/x-textencoder@10.3.1(transitive)
- Removed@polkadot/x-bigint@10.2.6(transitive)
- Removed@polkadot/x-global@10.2.6(transitive)
- Removed@polkadot/x-textdecoder@10.2.6(transitive)
- Removed@polkadot/x-textencoder@10.2.6(transitive)
Updated@babel/runtime@^7.20.13
Updated@polkadot/x-bigint@10.3.1
Updated@polkadot/x-global@10.3.1