Generate a random (bits)‐bit integer.

Synopsis

Declared in <random.h>

uint64_t
randbits(int bits) noexcept;

Return Value

A random integer whose low bits bits are random and the rest zero.

Parameters

Name

Description

bits

The number of random bits to produce (0 to 64).

Created with MrDocs