Description Usage Arguments Value Note Examples
using the quantum number generator server
1 2 3 4 |
quantum_runif(n, min = 0, max = 1,..., user, password)
setup_QRNG(user, password, ssl = TRUE, bufsize = 1e5)
QRNG_seed(user, password)
|
n |
number of random numbers to generate |
min |
minimum value |
max |
maximum value |
user |
user name; see note |
password |
password; see note |
ssl |
boolean; use SSL (secure, encrypted) connection |
bufsize |
integer; amount of random numbers per request to RNG |
... |
ignored |
quantum_runif
returns a numeric vector of length
n
with random numbers uniformly distributed between min
and max
.
setup_QRNG
sets up the connection to the quantum random number
generator and has as side effect that subsequent random numbers in
R are taken from this random number generator, e.g. those produced
by runif
and the like. See Random.user to find out
how this works.
QRNG_seed
returns an quantum random integer that can be used
to seed another random number generator, see set.seed
Registered users (see https://qrng.physik.hu-berlin.de/) can obtain random number streams from a quantum random number generator, which “provides randomness [...] based on the fundamental laws of nature.” Registration is used to avoid that a single user dominates a shared resource (bandwidth).
1 2 3 4 5 6 7 8 | # fill in correct user and password, or set them by
# options("qrng.user" = "my_user")
# options("qrng.password" = "my_password")
source("~/.Rprofile")
quantum_runif(100)
setup_QRNG()
# your quantum random numbers are now produced by:
runif(10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.