clan::Random Class Reference - ClanLib SDK
Description: clan::Random Class Reference

Public Member Functions | List of all members
clan::Random Class Reference
clanCore Crypto

Random class. More...

`#include <random.h>`

## Public Member Functions
| Random (int cache_size=1024)
| Constructs the object.
bool | get_random_bool ()
| Get the random boolean.
void | get_random_bytes (unsigned char *out_dest_ptr, int num_bytes)
| Get the random bytes.
void | get_random_bytes_nzero (unsigned char *out_dest_ptr, int num_bytes)
| Get the random bytes excluding bytes containing 0.

## Detailed Description

Random class.

Uses the operating system cryptographically secure pseudorandom number generator

## Constructor & Destructor Documentation

## ◆ Random()

clan::Random::Random | ( | int | cache_size = 1024 | ) |

Constructs the object.

cache_size = Random number cache size

## Member Function Documentation

## ◆ get_random_bool()

bool clan::Random::get_random_bool | ( |  | ) |

Get the random boolean.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

## ◆ get_random_bytes()

void clan::Random::get_random_bytes | ( | unsigned char * | out_dest_ptr,
|  | int | num_bytes )

Get the random bytes.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

## ◆ get_random_bytes_nzero()

void clan::Random::get_random_bytes_nzero | ( | unsigned char * | out_dest_ptr,
|  | int | num_bytes )

Get the random bytes excluding bytes containing 0.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

The documentation for this class was generated from the following file:

- random.h