Gathering detailed insights and metrics for extra-bigint
Gathering detailed insights and metrics for extra-bigint
Gathering detailed insights and metrics for extra-bigint
Gathering detailed insights and metrics for extra-bigint
extra-bigint.web
A BigInt can represent whole numbers larger than 2⁵³ - 1 {web}.
@extra-bigint/mod.min
Gets remainder of x/y with sign of y (floored division).
@polkadot/x-noble-hashes
An fork of @noble/hashes with extra protection on BigInt usage
@polkadot/x-noble-secp256k1
An fork of @noble/secp256k1 with extra protection on BigInt usage
npm install extra-bigint
Typescript
Module System
Node Version
NPM Version
TypeScript (84.62%)
JavaScript (15.38%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Stars
105 Commits
2 Forks
2 Watchers
2 Branches
3 Contributors
Updated on Apr 08, 2025
Latest Version
1.2.1
Package Id
extra-bigint@1.2.1
Unpacked Size
43.73 kB
Size
8.40 kB
File Count
6
NPM Version
10.9.2
Node Version
22.14.0
Published on
Apr 08, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A BigInt can represent whole numbers larger than 2⁵³ - 1 (1).
📦 Node.js,
🌐 Web,
📜 Files,
📰 Docs,
📘 Wiki.
ES2020 introduced BigInt as a built-in object. BigInt enables us to represent integers with arbitrary precision, allowing us to perform mathematical operations on large integers (2). This package includes common bigint functions related to querying about numbers, comparing numbers, performing rounded division, performing modulo operations, controlling range of numbers, performing arithmetic operations, obtaining divisors of a number (and related operations), getting the number of possible arrangements of a set of objects, performing geometry-related calculations, performing basic statistical analysis, and finding various statistical means.
This package is available in Node.js and Web formats. To use it on the web,
simply use the extra_bigint
global variable after loading with a <script>
tag from the jsDelivr CDN.
Stability: Experimental.
1const xbigint = require('extra-bigint'); 2// import * as xbigint from "extra-bigint"; 3// import * as xbigint from "https://unpkg.com/extra-bigint/index.mjs"; (deno) 4 5xbigint.isPrime(113n); 6// → true 7 8xbigint.floorDiv(7n, 3n); 9// → 2n 10 11xbigint.sqrt(81n); 12// → 9n 13 14xbigint.lcm(2n, 3n, 4n); 15// → 12n 16 17xbigint.log2(8n); 18// → 3n 19 20xbigint.sum(1n, 2n, 3n, 4n); 21// → 10n 22 23xbigint.mean(1n, 7n, 8n); 24// → 5n
Property | Description |
---|---|
is | Check if value is a bigint. |
compare | Compare two bigints. |
abs | Get the absolute of a bigint. |
sign | Get the sign of a bigint. |
floorDiv | Perform floor-divison of two bigints (\). |
ceilDiv | Perform ceiling-divison of two bigints. |
roundDiv | Perform rounded-divison of two bigints. |
rem | Find the remainder of x/y with sign of x (truncated division). |
mod | Find the remainder of x/y with sign of y (floored division). |
modp | Find the remainder of x/y with +ve sign (euclidean division). |
constrain | Constrain a bigint within a minimum and a maximum value. |
remap | Re-map a bigint from one range to another. |
lerp | Linearly interpolate a bigint between two bigints. |
isPow2 | Check if bigint is a power-of-2. |
isPow10 | Check if bigint is a power-of-10. |
prevPow2 | Find largest power-of-2 less than or equal to given bigint. |
prevPow10 | Find largest power-of-10 less than or equal to given bigint. |
nextPow2 | Find smallest power-of-2 greater than or equal to given bigint. |
nextPow10 | Find smallest power-of-10 greater than or equal to given bigint. |
log2 | Find the base-2 logarithm of a bigint. |
log10 | Find the base-10 logarithm of a bigint. |
sqrt | Find the square root of a bigint. |
cbrt | Find the cube root of a bigint. |
root | Find the nth root of a bigint. |
properDivisors | List all divisors of a bigint, except itself. |
aliquotSum | Sum all proper divisors of a bigint. |
minPrimeFactor | Find the least prime number which divides a bigint. |
maxPrimeFactor | Find the greatest prime number which divides a bigint. |
primeFactors | Find the prime factors of a bigint. |
primeExponentials | Find the prime factors and respective exponents of a bigint. |
isPrime | Check if bigint is prime. |
gcd | Find the greatest common divisor of bigints. |
lcm | Find the least common multiple of bigints. |
factorial | Find the factorial of a bigint. |
binomial | Find the number of ways to choose k elements from a set of n elements. |
multinomial | Find the number of ways to put n objects in m bins (n=sum(kᵢ)). |
hypot | Find the length of hypotenuse. |
sum | Find the sum of bigints (Σ). |
product | Find the product of bigints (∏). |
median | Find the value separating the higher and lower halves of bigints. |
modes | Find the values that appear most often. |
min | Find the smallest bigint. |
max | Find the largest bigint. |
range | Find the minimum and maximum bigint. |
variance | Find the mean of squared deviation of bigints from its mean. |
arithmeticMean | Find the arithmetic mean of bigints (µ). |
geometricMean | Find the geometric mean of bigints. |
harmonicMean | Find the harmonic mean of bigints. |
quadriaticMean | Find the quadriatic mean of bigints. |
cubicMean | Find the cubic mean of bigints. |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
6 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More