[#BloombergLP-bdlb-RandomDevice]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::RandomDevice
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for a suite of functions used for acquiring random numbers from the system&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;randomdevice&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct RandomDevice;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/RandomDevice/size_t.adoc[`size&lowbar;t`] 
| Alias for `bsls&colon;&colon;Types&colon;&colon;size&lowbar;type`, used for buffer sizes&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/RandomDevice/getRandomBytes.adoc[`getRandomBytes`] 
| Read the specified `numBytes` from the system random number generator into the specified `buffer`&period; Returns 0 on success, non&hyphen;zero otherwise&period; Note that this method may block if called repeatedly or if `numBytes` is high&period;
| xref:BloombergLP/bdlb/RandomDevice/getRandomBytesNonBlocking.adoc[`getRandomBytesNonBlocking`] 
| Read the specified `numBytes` from the system non&hyphen;blocking random number generator into the specified `buffer`&period; Returns 0 on success, non&hyphen;zero otherwise&period; Note that the cryptographic strength of samples drawn from this pool may or may not be lower than that of those drawn from the blocking pool, and may vary by platform&period;
|===



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