[][src]Function prime_check::prime_check

pub fn prime_check(n: u64, k: u32) -> bool

Implementation of Fermat Prime Test. Returns true if the number is probably prime, false if it is composite. This is exposed to JavaScript.

Arguments

Example

// remember that the first argument needs to be a BigInt, hence the 'n' at 
// the end. Could also use `BigInt(5)`. 
var result = module.prime_check(5n, 10);