Passwordfile library: util/opensslrandomdevice.h Source File

Passwordfile library 5.2.1 C++ library to read/write passwords from/to encrypted files

Loading...
Searching...
No Matches
opensslrandomdevice.h
Go to the documentation of this file.
1#ifndef PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
2#define PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
3
4#include "../global.h"
5
6#include <cstdint>
7#include <limits>
8
9namespace Util {
10
11 class PASSWORD_FILE_EXPORT OpenSslRandomDevice {
12public:
13 using result_type = std::uint32_t;
14
15 OpenSslRandomDevice();
16 result_type operator()() const;
17 bool status() const;
18 static constexpr result_type min();
19 static constexpr result_type max();
20};
21
22 constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::min()
23{
24 return std::numeric_limits<result_type>::min();
25}
26
27 constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::max()
28{
29 return std::numeric_limits<result_type>::max();
30}
31
32} // namespace Util
33
34#endif // PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
Util::OpenSslRandomDevice::max
static constexpr result_type max()
Definition opensslrandomdevice.h:27
Util::OpenSslRandomDevice::result_type
std::uint32_t result_type
Definition opensslrandomdevice.h:13
Util::OpenSslRandomDevice::operator()
result_type operator()() const
Generates a new random number.
Definition opensslrandomdevice.cpp:31
Util::OpenSslRandomDevice::status
bool status() const
Returns the status.
Definition opensslrandomdevice.cpp:52
Util::OpenSslRandomDevice::min
static constexpr result_type min()
Definition opensslrandomdevice.h:22
Util::OpenSslRandomDevice::OpenSslRandomDevice
OpenSslRandomDevice()
Constructs a new random device.
Definition opensslrandomdevice.cpp:24
global.h
PASSWORD_FILE_EXPORT
#define PASSWORD_FILE_EXPORT
Marks the symbol to be exported by the passwordfile library.
Definition global.h:14
Util
Contains utility classes and functions.
Definition openssl.h:17