Crate rug_miller_rabin

source ·
Expand description

Miller-Rabin Test (multi-threaded) for Integer (rug / GMP)

The methog is_prime test if a given number is probably prime using the Miller-Rabin method with the given number of iterations.

§Example

use miller_rabin::is_prime;

// Mersenne Prime (2^31 - 1)
let n: u64 = 0x7FFF_FFFF;
assert!(is_prime(&n, 16));

§Feature

Per default the test will be run in parallel (using rayon). The test can run iteratively deactivate the default feature by importing the crate.

Functions§

  • Test whether an integer n is likely prime using the Miller-Rabin primality test.