A simple (totally native) Python 3 API for ANU QRNG API.
Please use new API from ANU QRNG with API keys. Python example.
For each function exists in ANU QRNG API, there is a Python function.
They are [ANU QRNG]'s live numbers functions. In order to have Python functions, one might need to use urllib3 and beautifulsoup. I will not implement those because I don't know ANU allows us to scrap.
from qrng import get_random_uint8, get_random_uint16, get_random_hex16
# Requesting 10 random numbers between 0–255
print(get_random_uint8(10))
# Requesting 5 random numbers between 0–65535
print(get_random_uint16(10))
# Requesting 10 blocks of random numbers in hexadecimal format. Each block is between 0000–ffff
print(get_random_hex16(10, block_size=2))
You can read the file. It's very simple.
- Do not use this code for cryptography implementation.
- Do not use this code to send many requests. Instead of doing that, use the new API.