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

Fields

Name Type Description
isUniformRandomStream void Mark this as a Rng Stream
_advapi32 HMODULE
_RtlGenRandom extern(Windows) BOOL function(void*, uint)

Methods

Name Description
close Manually release the handle/connection to the system-specific entropy generator.
isOpen Check whether SystemEntropyStream is currently connected to with the system-specific entropy generator.
open Establishes a handle/connection to the system-specific entropy generator. Does nothing if already open.
read Fills the buffer with entropy from the system-specific entropy generator. Automatically opens SystemEntropyStream if it's closed.

Declaration

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

Authors

Copyright

License