⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
▼
userver
Documentation
►
API Groups
►
Namespaces
▼
Reference
►
Namespace Members
►
Class List
Class Index
►
Class Hierarchy
►
Class Members
▼
File List
►
en
►
testsuite
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
▼
userver
►
cache
►
compiler
▼
crypto
►
algorithm.hpp
►
base64.hpp
►
basic_types.hpp
certificate.hpp
crypto.hpp
►
exception.hpp
►
hash.hpp
private_key.hpp
public_key.hpp
►
random.hpp
►
signers.hpp
►
verifiers.hpp
►
decimal64
►
formats
►
fs
►
hostinfo
►
http
►
logging
►
tracing
►
utest
►
utils
►
yaml_config
►
userver
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
random.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/crypto/random.hpp
4
/// @brief Cryptographically-secure randomness
5
6
#
include
<
cstddef
>
7
#
include
<
string
>
8
#
include
<
type_traits
>
9
10
#
include
<
userver
/
utils
/
span
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
crypto {
15
16
namespace
impl {
17
18
void
GenerateRandomBlock(utils::span<std::byte> buffer);
19
20
}
// namespace impl
21
22
/// @brief Generate a block of randomness using a cryptographically secure RNG.
23
///
24
/// Uses a thread-local CryptoPP::AutoSeededRandomPool.
25
void
GenerateRandomBlock
(utils::span<
char
> buffer);
26
27
/// @overload
28
template
<
typename
T>
29
void
GenerateRandomBlock
(utils::span<T> buffer) {
30
static_assert
(std::is_trivially_copyable_v<T>);
31
impl::GenerateRandomBlock(utils::as_writable_bytes(buffer));
32
}
33
34
/// @overload
35
std::string
GenerateRandomBlock
(std::size_t size);
36
37
}
// namespace crypto
38
39
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
crypto
random.hpp
Generated on Wed May 15 2024 22:31:58 for userver by
Doxygen
1.10.0