crypto-random-prime

Generate a cryptographically-random probable prime number that passes the Miller-Rabin test with the given number of bits of entropy.

number-theory-2

A modern JavaScript library for number theory and modular arithmetic — including primes, totients, modular inverses, and more.