Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
random_string

Returns a cryptographically random string capable of being used as a filename. Essentially random_fill() + to_hex_string().

Synopsis
std::string utils::random_string(size_t randomlen)
Parameters

Type

Concept

Name

Description

size_t

randomlen

The number of bytes of randomness to use for the string.

Returns

A string representing the randomness at a 2x ratio, so if 32 bytes were requested, this string would be 64 bytes long.

Header

#include <boost/afio/v2/afio.hpp>

Complexity

Whatever the system API takes.

Exception Model

Any error from the operating system.


PrevUpHomeNext