passwordfile/util/opensslrandomdevice.h

36 lines
792 B
C
Raw 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"
2015-04-22 19:06:29 +02:00
#include <c++utilities/conversion/types.h>
#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:
using result_type = uint32;
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