Skip to content

dinhanhx/quantum-random-number-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ANU Quantum Random Numbers for Python

forthebadge

forthebadge

forthebadge

Introduction

A simple (totally native) Python 3 API for ANU QRNG API.

Please use new API from ANU QRNG with API keys. Python example.

Which functions are available?

For each function exists in ANU QRNG API, there is a Python function.

Which functions are not available?

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.

Example

Calling qrng.py functions

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.

Note

  • 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.

About

A simple (totally native) Python 3 API for ANU QRNG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages