WrappedStreamRNG

Takes a RandomStream (ex: SystemEntropyStream or HashDRBGStream) and wraps it into a UniformRNG InputRange.

Note that to conform to the expected InputRange interface, this must keep a copy of the last generated value in memory. If using this for security-related purposes, it may occasionally be appropriate to make an extra popFront() call before and/or after retreiving entropy values. This may decrease the chance of using a compromized entropy value in the event of a memory-sniffing attacker.

Declaration:

struct WrappedStreamRNG(RandomStream, StaticUByteArr)
	if(isRandomStream!RandomStream && isStaticArray!StaticUByteArr && is(ElementType!StaticUByteArr==ubyte))
	{...}
  1. struct WrappedStreamRNG(RandomStream, StaticUByteArr)
  2. struct WrappedStreamRNG(RandomStream, UIntType)
    struct WrappedStreamRNG (
    RandomStream
    UIntType
    ) if (
    isRandomStream!RandomStream &&
    isUnsigned!UIntType
    ) {
    enum isUniformRandom;
    enum empty;
    enum min;
    enum max;
    }

Members

Functions

popFront
void popFront()

Implements an InputRange

Properties

front
UIntType front [@property getter]

Implements an InputRange

Meta