[#BloombergLP-bdlb-GuidUtil-generate-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/GuidUtil.adoc[GuidUtil]::generate
:relfileprefix: ../../../
:mrdocs:

`generate` overloads

== Synopses

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

Generate and return a single GUID meeting the RFC 4122 version 4 specification, consisting of 122 randomly generated bits, two &quot;variant&quot; bits set to `10`, and four &quot;version&quot; bits set to `0100`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlb/Guid.adoc[Guid]
xref:BloombergLP/bdlb/GuidUtil/generate-04d.adoc[generate]();
----

[.small]#xref:BloombergLP/bdlb/GuidUtil/generate-04d.adoc[_» more&period;&period;&period;_]#

Generate a sequence of GUIDs meeting the RFC 4122 version 4 specification, and load the resulting GUIDs into the array referred to by the specified `result`&period; Optionally specify `numGuids`, indicating the number of GUIDs to load into the `result` array&period; If `numGuids` is not supplied, a default of 1 is used&period; An RFC 4122 version 4 GUID consists of 122 randomly generated bits, two &quot;variant&quot; bits set to `10`, and four &quot;version&quot; bits set to `0100`&period; The behavior is undefined unless `result` refers to a contiguous sequence of at least `numGuids` `Guid` objects&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
xref:BloombergLP/bdlb/GuidUtil/generate-047.adoc[generate](
    xref:BloombergLP/bdlb/Guid.adoc[Guid]* result,
    std::size&lowbar;t numGuids = 1);
----

[.small]#xref:BloombergLP/bdlb/GuidUtil/generate-047.adoc[_» more&period;&period;&period;_]#

Generate a sequence of GUIDs meeting the RFC 4122 version 4 specification, and load the bytes of the resulting GUIDs into the array referred to by the specified `result`&period; Optionally specify `numGuids`, indicating the number of GUIDs to load into the `result` array&period; If `numGuids` is not supplied, a default of 1 is used&period; An RFC 4122 version 4 GUID consists of 122 randomly generated bits, two &quot;variant&quot; bits set to `10`, and four &quot;version&quot; bits set to `0100`&period; The behavior is undefined unless `result` refers to a contiguous sequence of at least `16 &ast; numGuids` bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
xref:BloombergLP/bdlb/GuidUtil/generate-0f.adoc[generate](
    unsigned char* result,
    std::size&lowbar;t numGuids = 1);
----

[.small]#xref:BloombergLP/bdlb/GuidUtil/generate-0f.adoc[_» more&period;&period;&period;_]#


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