Skip to content

A collection of Python modules consisting different primality tests.

License

Notifications You must be signed in to change notification settings

avrha/primeTester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

primeTester

primeTester is a collection of Python modules consisting different primality tests.

Link to package on PyPI: primeTester.

Tests Included

  • Fermat Test
  • Miller Rabin Test
  • Solovay Strassen
  • AKS Test
  • Trial Division

Install

pip3 install PrimeTester

Usage

Import the test function from the python modules installed. Camel case is used for the functions names.

from millerRabin import millerRabin

For probability based tests (Fermat, Miller Rabin, Solovay Strassen) those functions take in two arguments. The first argument takes in a number to be tested as prime, the second is the number of test iterations.

print(fermat(5,100))

All the test functions will return a true or false value. A returned true value indicates that the inputted number is a prime. A returned false value indicates that the inputted number is not a prime.

About

A collection of Python modules consisting different primality tests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages