[#InsecureRandomContext-randbits-03] = xref:InsecureRandomContext.adoc[InsecureRandomContext]::randbits :relfileprefix: ../ :mrdocs: `randbits` overloads == Synopses Declared in `<random.h>` Same as above, but with compile‐time fixed bits count. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<int Bits> uint64_t xref:InsecureRandomContext/randbits-0b.adoc[randbits]() noexcept; ---- [.small]#xref:InsecureRandomContext/randbits-0b.adoc[_» more..._]# Generate a random (bits)‐bit integer. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- uint64_t xref:InsecureRandomContext/randbits-05.adoc[randbits](int bits) noexcept; ---- [.small]#xref:InsecureRandomContext/randbits-05.adoc[_» more..._]# == Return Value * A random integer whose low `Bits` bits are random and the rest zero. * A random integer whose low `bits` bits are random and the rest zero. == Parameters [cols="1,4"] |=== | Name| Description | *bits* | The number of random bits to produce (0 to 64). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#