1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![no_std]

//! An efficient public domain library to prove primality in minimal time for all 64-bit integers. Intended to be usable across any machines that support unsigned integer arithmetic and callable from any language that supports C-bindings. The algorithms may change in the future, however the API and worst-case complexity limits will not. 
//! 
//! For efficiency reasons two functions are provided, is_prime and is_prime_wc. is_prime is the general primality test used for arbitrary
//! integers, while is_prime_wc is the variant intended to be used as a helper function in other functions. Be wary that is_prime_wc is slower and 
//! does not always produce correct results, unless used against composites with large factors or unknown primes. See the documentation for it to see the errors to avoid. 
pub(crate) mod check;
pub(crate) mod hashbase;
pub(crate) mod primes;
pub use check::is_prime;
pub use check::is_prime_wc;


// This function is called on panic.
#[cfg(no_std)]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    loop {}
}