Skip to main content

A package to get prime numbers from bits.

Project description

Prime Bits

Prime Bits is a project focused on exploring and working with prime numbers in the context of computer science and programming.

Features

  • Efficient algorithms for prime number generation.
  • Utilities for prime number validation.
  • Tools for analyzing prime-related patterns.

How to install

python3 -m pip install prime-bits

How to use

from prime_bits import get_prime

get_prime(1024) # 1024 -> number of bits in the number.

Functions

  • get_prime - You can see what that function does above. 👆

In the current version v1.0.4 I have added 2 additional functions.

  • get_safe_prime - This function get's a safe prime number. (This uses multi-processing)
  • is_prime - This function checks if the number given is a prime. (This uses the Miller-Rabin primality test)
from prime_bits import get_safe_prime, is_prime


get_safe_prime(1024) # This will act the exact same way as the `get_prime` function. But it will ensure that the prime number given is a safe prime.

is_prime(some_prime_number) # This will checks using the Miller-Rabin primality test, is this number a prime. If so it will return True, False otherwise.

License

This project is licensed under the MIT License.

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

prime_bits-1.0.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

prime_bits-1.0.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file prime_bits-1.0.4.tar.gz.

File metadata

  • Download URL: prime_bits-1.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for prime_bits-1.0.4.tar.gz
Algorithm Hash digest
SHA256 5e8ef8799961664b7310eb05e82ddb41078a2dbfaad914130d274e9a257ebfdb
MD5 96c22318a11b668af5b88afc8397037c
BLAKE2b-256 236e308245556fc17c09543e5f8318f71392c6f3b91ea143f5e0817af0dd0c69

See more details on using hashes here.

File details

Details for the file prime_bits-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: prime_bits-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for prime_bits-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec0128398d00f280d39cd93e89ad7cf2f09e3bd890438fe1890b7a445761c79
MD5 42edb6241774d98962f4795a98442baf
BLAKE2b-256 bf8610444b8bd05da9f9577b052d18e52eb009377d494931b6e5a58b7b5edab7

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