[#InsecureRandomContext]
= InsecureRandomContext
:mrdocs:

xoroshiro128&plus;&plus; PRNG&period; Extremely fast, not appropriate for cryptographic purposes&period;

== Synopsis

Declared in `&lt;random&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class InsecureRandomContext
    : public xref:RandomMixin-01.adoc[RandomMixin&lt;InsecureRandomContext&gt;]
----

== Description

Memory footprint is very small, period is 2&circ;128 &hyphen; 1&period; This class is not thread&hyphen;safe&period;

Reference implementation available at https&colon;&sol;&sol;prng&period;di&period;unimi&period;it&sol;xoroshiro128plusplus&period;c See https&colon;&sol;&sol;prng&period;di&period;unimi&period;it&sol;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:RandomMixin-01.adoc[RandomMixin&lt;InsecureRandomContext&gt;]`
| Mixin class that provides helper randomness functions&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:InsecureRandomContext/result_type.adoc[`result&lowbar;type`] 
| Result type of the generator, for the UniformRandomBitGenerator concept&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:InsecureRandomContext/2constructor.adoc[`InsecureRandomContext`]         [.small]#[constructor]#
| Construct the context, deriving the initial state from a seed value&period;
| xref:InsecureRandomContext/operator_assign-07.adoc[`operator&equals;`] 
| Assignment operators
| xref:InsecureRandomContext/Reseed.adoc[`Reseed`] 
| Reset the context to a new state derived from a seed value&period;
| xref:InsecureRandomContext/fillrand.adoc[`fillrand`] 
| Fill a span with random bytes&period;
| xref:InsecureRandomContext/operator_call.adoc[`operator()`] 
| Generate the next random value, for the UniformRandomBitGenerator concept&period;
| xref:InsecureRandomContext/rand.adoc[`rand`] 
| Generate a random integer in its entire (non&hyphen;negative) range&period;
| xref:InsecureRandomContext/rand256.adoc[`rand256`] 
| generate a random uint256&period;
| xref:InsecureRandomContext/rand32.adoc[`rand32`] 
| Generate a random 32&hyphen;bit integer&period;
| xref:InsecureRandomContext/rand64.adoc[`rand64`] 
| Generate a random 64&hyphen;bit integer&period;
| xref:InsecureRandomContext/rand_exp_duration.adoc[`rand&lowbar;exp&lowbar;duration`] 
| Return a duration sampled from an exponential distribution (https&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Exponential&lowbar;distribution)&period; Successive events whose intervals are distributed according to this form a memoryless Poisson process&period; This should be used for repeated network events (e&period;g&period; sending a certain type of message) to minimize leaking information to observers&period;
| xref:InsecureRandomContext/rand_uniform_delay.adoc[`rand&lowbar;uniform&lowbar;delay`] 
| Return the time point advanced by a uniform random duration&period;
| xref:InsecureRandomContext/rand_uniform_duration.adoc[`rand&lowbar;uniform&lowbar;duration`] 
| Generate a uniform random duration in the range from 0 (inclusive) to range (exclusive)&period;
| xref:InsecureRandomContext/randbits-03.adoc[`randbits`] 
| `randbits` overloads
| xref:InsecureRandomContext/randbool.adoc[`randbool`] 
| Generate a random boolean&period;
| xref:InsecureRandomContext/randbytes-0e.adoc[`randbytes`] 
| `randbytes` overloads
| xref:InsecureRandomContext/randrange-07c.adoc[`randrange`] 
| `randrange` overloads
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:InsecureRandomContext/max.adoc[`max`] 
| Largest value the generator can produce&period;
| xref:InsecureRandomContext/min.adoc[`min`] 
| Smallest value the generator can produce&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:InsecureRandomContext/FlushCache.adoc[`FlushCache`] 
| Discard any random bits buffered from a previous rand64() call&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
