Skip to main content
Module

x/random_primes/mod.ts>isProbablePrime

Generate random prime numbers with Deno and the Miller-Rabin test.
Latest
function isProbablePrime
import { isProbablePrime } from "https://deno.land/x/random_primes@v1.3/mod.ts";

Test if a number is a probable prime number using Miller-Rabin.

Parameters

cand: bigint

the candidate prime number to test.

optional
tests: number

the number of tests to complete on the candidate (optional). Default is 10.

Returns

boolean

a boolean result of probable prime (true) or definite composite (false)