| Home | Libraries | People | FAQ | More

#### 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 `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

`websocket::stream::secure_prng`

Convenience header `<boost/beast/websocket.hpp>`