A collection of Python modules consisting different primality tests.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for primeTester-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7fa0f1c633ecd72ddada11cb5ec668c3110fe8392216fea9d63f7333d93539 |
|
MD5 | f7c96f2f30ba8e9e112c579468d80b51 |
|
BLAKE2b-256 | b4865eccd9ad32eb0dcd894c94c8d068c96961237f82e570ac255cc87d4507a2 |