From d2e664905925dbff042693a48ab45d08d79bcdc4 Mon Sep 17 00:00:00 2001 From: "Callum Fortune (Caldog)" <63158857+callum-fortune@users.noreply.github.com> Date: Sat, 27 Apr 2024 00:57:18 +0100 Subject: [PATCH] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 19c9fd4..2becc8f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ A complete Rust implementation of the Miller Rabin primality test algorithm. Vie cargo build cargo run ``` +- If you wish to use this as a library you can import and use it as follows: + + ``` + use rust_miller_rabin::miller_rabin + + fn is_prime(number: BigInt) -> bool { + println!("Checking prime"); + return miller_rabin(&number); + } + ``` + - I have included tests for the project which will test small primes, large primes, small non-primes and large non-primes. Run these with: ```