Skip to main content

Unpredictable random number generation and character generation (random + secrets module combined).

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

secretrandom

The combination of the random module's features with the security of the secrets module for unpredictable random number generation and random character generation.

Includes:

  • Password & passcode generation for authentication.
  • Random number generation features from the random module.
  • Powered with ⚡true optimization and unpredictability.⚡

Github repo: https://github.com/dUhEnC-39/secretrandom

Changelog: https://github.com/dUhEnC-39/secretrandom/blob/main/CHANGELOG.txt

Documentation guide

All functions:

  • randchar() — Password/Character generation
  • randcode() — Passcode and PIN generation
  • randint() — Random whole integer generation
  • randflt() — Random float generation
  • choice() — For random choices
  • shuffle() — For random shuffles

randchar()

Generates a random character based on int: length (1st argument)

import secretrandom

password = secretrandom.randchar(1)
print(password) # Prints out a random character

Print multiple characters to makeup a password.

password = secretrandom.randchar(17)
print(password) # Prints out multiple characters like a password

randcode()

Generates passcodes or PINs based on the length as the only argument.

passcode = secretrandom.randcode(6)
print(passcode) # Prints out passcode with 6 integers   

randint()

Random whole integer generator starting from 1st arg to 2nd arg with steps (3rd arg)

random_num = secretrandom.randint(1, 4)
print(random_num) # Prints out a number between 1-4    

OR

random_num = secretrandom.randint(1, 6, 2)
print(random_num) # Prints out a number either 2, 4, or 6   

randflt()

Random float generator from 1st arg to 2nd arg

random_flt = secretrandom.randflt(1, 2)
print(random_flt) # Prints out random float from 1 to 2 (like 1.673)  

choice()

Chooses part of a list of values.

choice = secretrandom.choice('abcd')
print(choice) # Prints out what it chose (either a, b, c, or d)  

And finally shuffle()

Shuffles a list of values.

data = ['a', 'b', 'c', 'd']
secretrandom.shuffle(data)
print(data) # Shuffles the list of values.

Any questions? Email here

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

secretrandom-2.2.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

secretrandom-2.2.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file secretrandom-2.2.2.tar.gz.

File metadata

  • Download URL: secretrandom-2.2.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for secretrandom-2.2.2.tar.gz
Algorithm Hash digest
SHA256 5a8e267826169bdb676beb082de8cfd43cf610606cde2a7436a01a821c2a120b
MD5 132af21829cf33a833b84d2da5086f77
BLAKE2b-256 69739b8b6cebb917bccd77d95e6a88468a92a4fc44bc2a7c959b6d7ac0d400f2

See more details on using hashes here.

File details

Details for the file secretrandom-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: secretrandom-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for secretrandom-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 86481e6c915fb7a4d35bef86ef3bbaac9610a9302879b5bc7c1f7389b7c8461a
MD5 d8948eac138a7c08968fc1251da3c171
BLAKE2b-256 c616a6bb8ce1446368191edb42dce5373615029a50e96607f87f0b97cae4c69d

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