SystemEntropyStream

The underlying stream-like interface for SystemEntropy.

On Windows, pathToRandom and pathToStrongRandom must be null because Windows uses a system call, not a file path, to retreive system entropy.

On Posix, pathToRandom must NOT be null. If pathToStrongRandom is null, then pathToStrongRandom is assumed to be pathToRandom.

Because std.stream is pending a full replacement, be aware that stream-like random number generators currently use a temporary design that may change once a new std.stream is available.

Declaration:

struct SystemEntropyStream(string pathToRandom = defaultPathToRandom,
	string pathToStrongRandom = defaultPathToStrongRandom) {...}
struct SystemEntropyStream (
string pathToRandom = defaultPathToRandom
string pathToStrongRandom = defaultPathToStrongRandom
) {
enum isUniformRandomStream;
}

Members

Properties

isOpen
bool isOpen [@property getter]

Check whether SystemEntropyStream is currently connected to with the system-specific entropy generator.

Static functions

close
void close()

Manually release the handle/connection to the system-specific entropy generator.

open
void open()

Establishes a handle/connection to the system-specific entropy generator. Does nothing if already open.

read
void read(ubyte[] buf, Flag!"PredictionResistance" predictionResistance = No.PredictionResistance)

Fills the buffer with entropy from the system-specific entropy generator. Automatically opens SystemEntropyStream if it's closed.

Meta