userver: userver/crypto/random.hpp File Reference
Loading...
Searching...
No Matches
random.hpp File Reference

Detailed Description

Cryptographically-secure randomness.

Definition in file random.hpp.

Go to the source code of this file.

#include <cstddef>
#include <string>
#include <type_traits>
#include <userver/utils/span.hpp>

Namespaces

namespace  crypto
 Cryptography support.
 

Functions

void crypto::GenerateRandomBlock (utils::span< char > buffer)
 Generate a block of randomness using a cryptographically secure RNG.
 
template<typename T >
void crypto::GenerateRandomBlock (utils::span< T > buffer)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string crypto::GenerateRandomBlock (std::size_t size)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.