find-prime

4.0.2 • Public • Published

find-prime

Find a prime.

Example

var findPrime = require('find-prime');

findPrime(100, function(error, prime) {
  console.log(prime.toString());
  // => '1191049104492544277555931735013'
});

Installation

$ npm install find-prime

API

var findPrime = require('find-prime');

findPrime(bits, [options], callback)

Searches for a possible prime number of size bits. Calls callback(error, bigint) when a candidate has been found. bigint is an instance of bigi.

Through the optional options Object, you can set the maximum amount of time to block the main thread (options.maxBlockTime) and the number of Miller-Rabin tests to run (options.millerRabinTests).

Readme

Keywords

Package Sidebar

Install

npm i find-prime

Weekly Downloads

7

Version

4.0.2

License

MIT

Unpacked Size

5.34 kB

Total Files

4

Last publish

Collaborators

  • kenan