hap.random.device

Provides access to non-deterministic sources of randomness. These are implemented as Input Ranges and in many cases are architecture- or OS-dependent.

As with the pseudo-random number generators provided elsewhere in this package, all random devices are implemented as final classes to ensure reference semantics.

Warning: This module is currently experimental and should be used with caution. It is not imported automatically as part of the hap.random package but must be imported individually in its own right. Its API may change in future releases.

Members

Aliases

UniformRandomDeviceTypes
alias UniformRandomDeviceTypes = TypeTuple!(DevRandom!ushort, DevRandom!uint, DevRandom!ulong, DevURandom!ushort, DevURandom!uint, DevURandom!ulong)

TypeTuple of all random devices defined in this module. that act as a uniform random number generator. Note that the available random devices may be dependent on operating system and/or hardware architecture.

UniformRandomDeviceTypes
alias UniformRandomDeviceTypes = TypeTuple!()
Undocumented in source.

Classes

RandomFileStream
class RandomFileStream(string filename, T)

Reads randomness from an infinite filestream. In practice this will typically be used to read from system sources of randomness such as (on Posix) /dev/random or /dev/urandom.

Templates

DevRandom
template DevRandom(T)

Generates uniformly distributed random numbers in the interval [T.min, T.max] using /dev/random as the source of randomness.

DevURandom
template DevURandom(T)

Generates uniformly distributed random numbers in the interval [T.min, T.max] using /dev/urandom as the source of randomness.

Meta

Source

See Source File
$(HAPSRC hap/random/_device.d)