quick-is-prime
Advanced tools
Comparing version 1.0.3 to 1.0.5
{ | ||
"name": "quick-is-prime", | ||
"version": "1.0.3", | ||
"version": "1.0.5", | ||
"description": "Test if a number is prime in constant time, using a cached Sieve of Eratosthenes.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha" | ||
}, | ||
@@ -30,3 +30,6 @@ "repository": { | ||
"sieve-set": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.3.0" | ||
} | ||
} |
# quick-is-prime | ||
[![NPM Version](https://img.shields.io/npm/v/quick-is-prime.svg)](https://www.npmjs.com/package/quick-is-prime) | ||
[![Build Status](https://travis-ci.org/dsernst/quick-is-prime.svg?branch=master)](https://travis-ci.org/dsernst/quick-is-prime) | ||
@@ -27,4 +28,4 @@ Test if a number is prime in constant time, using a cached Sieve of Eratosthenes. This is especially helpful to test many numbers' primality. | ||
// More challenging examples | ||
console.log(isPrime(9998903)) // true, only takes 1.5 seconds | ||
console.log(isPrime(9893899)) // true, adds no extra calculation time | ||
console.log(isPrime(9998903)) // true, takes 1.5 seconds | ||
console.log(isPrime(9893899)) // true, takes less than a millisecond | ||
``` | ||
@@ -35,1 +36,10 @@ | ||
**For best results**, check primes highest to lowest. Or alternatively, if you know what the upper bound will be, just check that first to not be concerned with the order. | ||
## Tests | ||
To run the test suite, first install the dependencies, then run `npm test`: | ||
``` | ||
$ npm install | ||
$ npm test | ||
``` |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
3227
6
35
0
44
1