A true random number generator using system sensor noise
Project description
NonPseudoRandom
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.
It inherites all methods of the native random class and therefore supports all of the expected functionalities.
Examples from native random methods:
import nonpseudorandom as random
print(random.random()) # Generate a random float in [0.0, 1.0)
print(random.randint(1, 10)) # Generate a random integer between 1 and 10
print(random.choice(['a', 'b', 'c'])) # Randomly select an element from a list
print(random.uniform(1.0, 10.0)) # Generate a random float between 1.0 and 10.0
my_list = [1, 2, 3, 4, 5]
random.shuffle(my_list)
print(my_list) # The list will be shuffled
population = [1, 2, 3, 4, 5]
sample = random.sample(population, 3)
print(sample) # Randomly sample 3 unique elements from the population
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file nonpseudorandom-0.3.0.tar.gz
.
File metadata
- Download URL: nonpseudorandom-0.3.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83562b8814d3038f3837b5a2312540db5eee03817e691432128197c5a6d1c05c |
|
MD5 | ac92ca84346b1ce3c84ebca26d702372 |
|
BLAKE2b-256 | 644aa11ccfbb7b875d8ad8c838a3ec2016d9823ef8a680089046216b4d2e30c8 |
File details
Details for the file nonpseudorandom-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: nonpseudorandom-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 791acf9130122a9fd0dcb405f477eb3e6501ac4a9ca0f0d74203d4bc90ecb66c |
|
MD5 | 2c53920c4a559cc7d2f51004e04138e0 |
|
BLAKE2b-256 | 0be8a183f9d1c48ca836a4a0e49e9ef95cd8239de187acea688d847d89c8b744 |