Skip to main content

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

primeTester-1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

primeTester-1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file primeTester-1.1.tar.gz.

File metadata

  • Download URL: primeTester-1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for primeTester-1.1.tar.gz
Algorithm Hash digest
SHA256 02ffcbc085b6c473e88d2fca061536ca197cea0aa61882ee9bcbf9012e538a8e
MD5 01edee26cbc103d6766ade77e52b7986
BLAKE2b-256 538bbc2ff4874015b18ae158a9ba5b39e9154ec937a13352c505d069ee040f1e

See more details on using hashes here.

File details

Details for the file primeTester-1.1-py3-none-any.whl.

File metadata

  • Download URL: primeTester-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for primeTester-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be7fa0f1c633ecd72ddada11cb5ec668c3110fe8392216fea9d63f7333d93539
MD5 f7c96f2f30ba8e9e112c579468d80b51
BLAKE2b-256 b4865eccd9ad32eb0dcd894c94c8d068c96961237f82e570ac255cc87d4507a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page