/ src / crypto / crypto_true_random.h
crypto_true_random.h
 1  #pragma once
 2  
 3  #include <stdint.h>
 4  #include <stddef.h>
 5  
 6  #ifdef __cplusplus
 7  
 8  namespace crypto
 9  {
10  	class TrueRandom
11  	{
12  	public:
13  		static void Bytes(uint8_t* output, size_t size);
14  		static uint32_t Range(uint32_t min, uint32_t max);
15  		static float Range(float min, float max);
16  		static float Value();
17  	private:
18  		TrueRandom() = delete;
19  		virtual ~TrueRandom() = delete;
20  		TrueRandom(const TrueRandom&) = delete;
21  		TrueRandom& operator=(const TrueRandom&) = delete;
22  	};
23  }
24  
25  #endif // __cplusplus
26  
27  #ifdef __cplusplus
28  extern "C" {
29  #endif // __cplusplus
30  
31  extern uint32_t crypto_true_random_range(uint32_t min, uint32_t max);
32  
33  #ifdef __cplusplus
34  }
35  #endif // __cplusplus