Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quick-is-prime

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quick-is-prime - npm Package Compare versions

Comparing version 1.0.3 to 1.0.5

.travis.yml

7

package.json
{
"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
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc