rustic_factors
is a personal project that explores various number factorization algorithms using Rust. It is designed to learn some of Rust’s features such as generics, dynamic dispatch, and procedural macros while experimenting with essential design patterns including Strategy, Builder, and New Type. For a detailed overview of the project architecture and the application of these patterns, please refer to the accompanying ARCHITECTURE document.
To install rustic_factors
, ensure Rust and Cargo are installed on your machine. You can then build the project using cargo
$ cargo build --release
To ensure your installation is functioning as expected, run the test suite with
$ cargo test
To use rustic_factors
, specify an algorithm and a positive number less than 2512
$ cargo run --release [algorithm] [number]
For example, to factorize the number
$ cargo run --release pollards_rho 8051
Additional factorization commands are fermats_factorization_method
and trial_division
. Additionally, rustic_factors
includes the Miller-Rabin primality test to check if a number is prime
$ cargo run --release miller_rabin 561
This command checks whether