Wt: Wt::WRandom Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions
Wt::WRandom Class Reference

Random number generator. More...

`#include <Wt/WRandom>`

List of all members.

## Static Public Member Functions
static unsigned int | get ()
| Returns a random number.
static std::string | generateId (int length=16)
| A utility method to generate a random id.

## Detailed Description

Random number generator.

If an implementation is available for your OS, this class generates high-entropy random numbers, suitable for secret ids (e.g. this is used to generate Wt's session IDs).

## Member Function Documentation

std::string Wt::WRandom::generateId | ( | int | length = `16` | ) | `[static]`

A utility method to generate a random id.

The id is composed of small and capitalized roman characters and numbers [a-zA-Z0-9].

See also:
  get()

unsigned int Wt::WRandom::get | ( |  | ) | `[static]`

Returns a random number.

This returns a high-entropy (non deterministic) random number on platforms for which this is supported (currently only Linux, Windows and MacOS X).

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator