1//
2// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3//
4// Distributed under the Boost Software License, Version 1.0. (See accompanying
5// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6//
7// Official repository: https://github.com/boostorg/beast
8//
9
10#ifndef BOOST_BEAST_WEBSOCKET_DETAIL_PRNG_HPP
11#define BOOST_BEAST_WEBSOCKET_DETAIL_PRNG_HPP
12
13#include <boost/beast/core/detail/config.hpp>
14#include <boost/config.hpp>
15#include <cstdint>
16#include <random>
17
18namespace boost {
19namespace beast {
20namespace websocket {
21namespace detail {
22
23using generator = std::uint32_t(*)();
24
25//------------------------------------------------------------------------------
26
27// Manually seed the prngs, must be called
28// before acquiring a prng for the first time.
29//
30BOOST_BEAST_DECL
31std::uint32_t const*
32prng_seed(std::seed_seq* ss = nullptr);
33
34// Acquire a PRNG using the TLS implementation if it
35// is available, otherwise using the no-TLS implementation.
36//
37BOOST_BEAST_DECL
38generator
39make_prng(bool secure);
40
41} // detail
42} // websocket
43} // beast
44} // boost
45
46#ifdef BOOST_BEAST_HEADER_ONLY
47#include <boost/beast/websocket/detail/prng.ipp>
48#endif
49
50#endif
51

source code of boost/libs/beast/include/boost/beast/websocket/detail/prng.hpp