Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

websocket::seed_prng

Manually provide a one-time seed to initialize the PRNG.

Synopsis

Defined in header <boost/beast/websocket/stream.hpp>

void
seed_prng(
    std::seed_seq& ss);
Description

This function invokes the specified seed sequence to produce a seed suitable for use with the pseudo-random number generator used to create masks and perform WebSocket protocol handshakes. If a seed is not manually provided, the implementation will perform a one-time seed generation using std::random_device. This function may be used when the application runs in an environment where the random device is unreliable or does not provide sufficient entropy.

Preconditions

This function may not be called after any websocket stream objects have been constructed.

Parameters

Name

Description

ss

A reference to a std::seed_seq which will be used to seed the pseudo-random number generator. The seed sequence should have at least 256 bits of entropy.

See Also

stream::secure_prng


PrevUpHomeNext