Skip to main content

A true random number generator using system sensor noise

Project description

NonPseudoRandom

PyPI version Supported Python versions PyPI downloads

NonPseudoRandom is a Python package that generates true random numbers using sensor noise from your local system. It serves as a drop-in replacement for Python's native random module.

Supported Sensors

NonPseudoRandom utilizes various types of system sensors to generate randomness. The supported sensor types are as follows:

Sensor Type Description
CPU Temperature Measures the temperature of the CPU using psutil.
Microphone Noise Captures ambient noise from the microphone using sounddevice.
Webcam Noise Captures visual noise from the webcam using opencv-python.

Installation

You can install NonPseudoRandom via pip:

pip install nonpseudorandom

Usage

NonPseudoRandom can be used as a drop-in replacement for Python's built-in random module. Here are some examples:

Example 1: Generating a Random Float

import nonpseudorandom as random

print(random.random())  # Generate a random float in [0.0, 1.0)

Example 2: Generating a Random Integer

import nonpseudorandom as random

print(random.randint(1, 10))  # Generate a random integer between 1 and 10

Example 3: Choosing a Random Element from a List

import nonpseudorandom as random

print(random.choice(['a', 'b', 'c']))  # Randomly select an element from a list

Example 4: Shuffling a List

import nonpseudorandom as random

my_list = [1, 2, 3, 4, 5]
random.shuffle(my_list)
print(my_list)  # The list will be shuffled

Example 5: Sampling from a Population

import nonpseudorandom as random

population = [1, 2, 3, 4, 5]
sample = random.sample(population, 3)
print(sample)  # Randomly sample 3 unique elements from the population

Example 6: Generating a Random Float in a Range

import nonpseudorandom as random

print(random.uniform(1.0, 10.0))  # Generate a random float between 1.0 and 10.0

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

nonpseudorandom-0.2.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

nonpseudorandom-0.2.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file nonpseudorandom-0.2.1.tar.gz.

File metadata

  • Download URL: nonpseudorandom-0.2.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for nonpseudorandom-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d35bb048ba478f9f3a1d5dffc8eb28f2a48b066d770c2bb5dba9d41402efc8b7
MD5 245906cdfc9486e9e29cb75aa6c4f2c3
BLAKE2b-256 a30dffe919b8efaf3356392f64d249286ab17973204c798f8dec5a5f5129e783

See more details on using hashes here.

File details

Details for the file nonpseudorandom-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonpseudorandom-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f05ada67abba92ae1823370796112f72aa9292b8da183f58ddd22899db92089
MD5 b7827c73c9f52c651a619c6b6ec2a619
BLAKE2b-256 1dfe8b7b9b3a68f46f7d7510a9317b47394b9e1a4d5735290751e2f0eab61d7d

See more details on using hashes here.

Supported by

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