Gathering detailed insights and metrics for fast-prime-client
Gathering detailed insights and metrics for fast-prime-client
Gathering detailed insights and metrics for fast-prime-client
Gathering detailed insights and metrics for fast-prime-client
npm install fast-prime-client
Typescript
Module System
Node Version
NPM Version
70.6
Supply Chain
98.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
Total Downloads
1,556
Last Day
2
Last Week
9
Last Month
86
Last Year
639
Minified
Minified + Gzipped
Latest Version
0.1.0
Package Id
fast-prime-client@0.1.0
Unpacked Size
869.11 kB
Size
246.50 kB
File Count
35
NPM Version
8.15.0
Node Version
18.10.0
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
-65.4%
9
Compared to previous week
Last month
126.3%
86
Compared to previous month
Last year
138.4%
639
Compared to previous year
1
Fastest Prime Number Calculation logic (checks, random generator, prime range generator, primes count generator, summation of primes, factorial of primes, primes generator)
This probably is the BEST solution in the internet as of today 11th March 2022
This same code can be applied in any languages like Python
, Go
Lang, Java
, PHP
, Node.js
, Javascript
, C
, C++
, .NET
, Rust
, etc with the same logic and have performance benefits. It is pretty fast based on the number of iterations needed. Performance time checks were not consistent across languages (in my local system - to be direct about wordings). I have not seen this implemented before and has been indigenously done. Feedback and usage is welcome.
Max iterations 16666 for n == 100000 instead of 100000 of conventional way
. The iterations
counts for different ways for Prime number check 100007 can be seen as follows:
count: Prime Conventional way for 83 is 81
Is Prime 83 isPrimeConventionalWay: True
count: Prime Squareroot way 83 is 8
Is Prime 83 isPrimeSquarerootWay: True
count: Prime Unconventional way for 83 is 14
Is Prime 83 prime (SUGGESTED): True
count: Prime AKS - Mersenne primes - Fermat's little theorem or whatever way 83 is 2
Is Prime 83 isprimeAKSWay: True
count: Prime Conventional way for 169 is 12
Is Prime 169 isPrimeConventionalWay: False
count: Prime Squareroot way 169 is 12
Is Prime 169 isPrimeSquarerootWay: False
count: Prime Unconventional way for 169 is 1
Is Prime 169 prime (SUGGESTED): False
count: Prime AKS - Mersenne primes - Fermat's little theorem or whatever way 169 is 4
Is Prime 169 isprimeAKSWay: False
count: Prime Conventional way for 100007 is 96
Is Prime 100007 isPrimeConventionalWay: False
count: Prime Squareroot way 100007 is 96
Is Prime 100007 isPrimeSquarerootWay: False
count: Prime Unconventional way for 100007 is 15
Is Prime 100007 prime (SUGGESTED): False
count: Prime AKS - Mersenne primes - Fermat's little theorem or whatever way 100007 is 32
Is Prime 100007 isprimeAKSWay: False
count: Prime Conventional way for 300530164787 is 1180
Is Prime 300530164787 isPrimeConventionalWay: False
count: Prime Squareroot way 300530164787 is 1180
Is Prime 300530164787 isPrimeSquarerootWay: False
count: Prime Unconventional way for 300530164787 is 196
Is Prime 300530164787 prime (SUGGESTED): False
count: Prime AKS - Mersenne primes - Fermat's little theorem or whatever way 300530164787 is 393
Is Prime 300530164787 isprimeAKSWay: False
./node_modules/src/client/primes.js
and node_modules/src/client/primes.min.js
./node_modules/src/client/primes.all.js
and node_modules/src/client/primes.all.min.js
https://unpkg.com/fast-prime@{version}/src/client/primes.all.js
. Example https://unpkg.com/fast-prime@0.0.64/src/client/primes.all.min.js
./node_modules/src/client/primes.ip.js
and node_modules/src/client/primes.ip.min.js
https://unpkg.com/fast-prime@{version}/src/client/primes.ip.js
. Example https://unpkg.com/fast-prime@0.0.64/src/client/primes.ip.min.js
Different ways of prime number checks (isprime)
- Fast prime (Recommended innovative function)
- Iterative/Recursive (Conventional iterative way)
- SquareRoot (AKS - Mersenne primes - Fermat's little theorem)
Different ways of getting primes (using all above different ways)
- Fetch prime between two number range (min - max)
- Fetch counts (numbers) of prime starting from any number
- Random prime number generator [TODO]
- Optimized function with pre-calculated stored values (< 10000, < 100000, < 1000000)
- Stored value calculation Failover to JIT calculation using above formulaes
Different ways of getting summation of primes (using all above different ways)
- Fetch summation of prime between two number range (min - max)
- Fetch summation of counts (numbers) of prime starting from any number
- Fetch summation of Custom array provided [TODO]
- Fetch factorial - Optimized function with pre-calculated stored values (< 10000, < 100000, < 1000000)
- Stored value calculation Failover to JIT calculation using above formulaes
Different ways of getting factorial of primes (using all above different ways)
- Fetch factorial of prime between two number range (min - max)
- Fetch factorial of counts (numbers) of prime starting from any number
- Fetch factorial of Custom array provided [TODO]
- Fetch factorial - Optimized function with pre-calculated stored values (< 10000, < 100000, < 1000000)
- Stored value calculation Failover to JIT calculation using above formulaes
// Usage API for client
// Check demos folder for usage in the github repos
// https://github.com/ganeshkbhat/fastprimenumbers/tree/main/nodejs/demos
primes().fast // Recommended or Suggested way
primes().primes // Recommended or Suggested way
primes().recursive
primes().sqrootExpressive
primes().sqroot
primesCount().alternateWays
primesCount().alternateWaysOptimized (async - promise)
primesCount().fast
primesCount().fastOptimized (async - promise)
primesRange().alternateWays
primesRange().alternateWaysOptimized (async - promise)
primesRange().fast
primesRange().fastOptimized (async - promise)
primesSum().alternateWaysCount
primesSum().alternateWaysCountOptimized (async - promise)
primesSum().alternateWaysRange
primesSum().alternateWaysRangeOptimized (async - promise)
primesSum().fastCount
primesSum().fastCountOptimized (async - promise)
primesSum().fastRange
primesSum().fastRangeOptimized (async - promise)
primesFactorial().factorial
primesFactorial().alternateWaysCount
primesFactorial().alternateWaysCountOptimized (async - promise)
primesFactorial().alternateWaysRange
primesFactorial().alternateWaysRangeOptimized (async - promise)
primesFactorial().fastCount
primesFactorial().fastCountOptimized (async - promise)
primesFactorial().fastRange
primesFactorial().fastRangeOptimized (async - promise)
Stack overflow Link for Calculations
Custom Crediting License PROPRIETARY LICENSE AGREEMENT ONLY
No vulnerabilities found.
No security vulnerabilities found.