Find a prime
npm install find-primeFind a prime.
`` javascript
var findPrime = require('find-prime');
findPrime(100, function(error, prime) {
console.log(prime.toString());
// => '1191049104492544277555931735013'
});
`
` bash`
$ npm install find-prime
` javascript`
var findPrime = require('find-prime');
Searches for a possible prime number of size bits. Callscallback(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 timeoptions.maxBlockTime
to block the main thread () and the number ofoptions.millerRabinTests`).
[Miller-Rabin tests][] to run (
[bigi]: https://github.com/cryptocoinjs/bigi
[Miller-Rabin tests]: https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test