Skip to content

hesampakdaman/rustic_factors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustic_factors

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.

Installation

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

Usage

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 $8051$ using Pollard’s Rho, enter

$ 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 $561$ is a prime number using the Miller-Rabin test.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Languages