rust_miller_rabin/lib.rs
1pub mod miller_rabin;
2
3// ! This is a library for performing primality testing using the Miller-Rabin algorithm.
4// !
5// ! Heavily based on the following repository:
6// !
7// ! https://github.com/jsanders/rust-rsa
8// !
9// ! # Usage
10// !
11// ! To use this library, add it as a dependency in your `Cargo.toml`:
12// !
13// ! ```toml
14// ! [dependencies]
15// ! rust_miller_rabin = "0.1.0"
16// ! ```
17// !
18// ! Then, in your Rust code, you can use it as follows:
19// !
20// ! ```rust
21// ! use rust_miller_rabin::miller_rabin::miller_rabin;
22// ! use num_bigint::BigInt;
23// !
24// ! fn main() {
25// ! let num = BigInt::from(1234567890);
26// ! if is_prime(&num) {
27// ! println!("{} is probably prime", num);
28// ! } else {
29// ! println!("{} is composite", num);
30// ! }
31// ! }
32// ! '''