passwordfile/util/opensslrandomdevice.h

35 lines
774 B
C
Raw Permalink Normal View History

#ifndef PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
#define PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
2015-04-22 19:06:29 +02:00
2016-08-29 15:42:07 +02:00
#include "../global.h"
2019-03-13 19:08:30 +01:00
#include <cstdint>
#include <limits>
2015-04-22 19:06:29 +02:00
namespace Util {
2017-05-01 03:25:30 +02:00
class PASSWORD_FILE_EXPORT OpenSslRandomDevice {
2015-04-22 19:06:29 +02:00
public:
2019-03-13 19:08:30 +01:00
using result_type = std::uint32_t;
2015-04-22 19:06:29 +02:00
OpenSslRandomDevice();
result_type operator()() const;
2015-04-22 19:06:29 +02:00
bool status() const;
static constexpr result_type min();
static constexpr result_type max();
2015-04-22 19:06:29 +02:00
};
constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::min()
{
return std::numeric_limits<result_type>::min();
}
constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::max()
{
return std::numeric_limits<result_type>::max();
}
2018-03-20 20:11:31 +01:00
} // namespace Util
2015-04-22 19:06:29 +02:00
#endif // PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H