True random numbers in Python
Project description
verarandom
True random numbers in Python.
Full documentation: https://alighahraei.github.io/verarandom/
Usage
This module provides random.Random subclasses, so they implement all random functions (except Bookkeeping functions) with true randomness. They require an internet connection to work and will either raise a ConnectionError or a subclass of verarandom.errors.VeraRandomError for validation failures and other related error conditions.
>>> from verarandom import RandomOrg
>>> r = RandomOrg()
>>> r.quota_estimate
1000000
>>> r.randint(1, 10, n=5)
[3, 4, 10, 3, 7]
>>> r.quota_estimate # bits were deducted from quota
999986
>>> r.randint(3, 5, n=1)
[5]
>>> r.randint(-10, 3) # a single number (like random.randint)
-2
>>> r.random()
0.040120765652295
>>> r.choice(['rock', 'paper', 'scissors'])
'scissors'
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
verarandom-2.0.0.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for verarandom-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 276038edbe57625b18de1e1ba1267c69510260415500b6c8be4d3715ebf9d4f7 |
|
MD5 | 50b6a01cd4a3c6bf77d12919e972947c |
|
BLAKE2b-256 | 9ac411ee7b54953e7c5b09d00ab23eceeca644d56a69d7d302688dbbc106e45b |