11#ifndef OPENCBDC_TX_SRC_COMMON_RANDOM_SOURCE_H_
12#define OPENCBDC_TX_SRC_COMMON_RANDOM_SOURCE_H_
14#include "crypto/sha256.h"
49 return std::numeric_limits<result_type>::min();
55 return std::numeric_limits<result_type>::max();
66 auto hash_at_index(uint64_t idx) ->
hash_t;
70 std::queue<unsigned char> m_buf;
Generates pseudo-random numbers from a given entropy source.
random_source(random_source &&other)=delete
random_source(const std::string &source_file)
Constructor.
auto operator()() -> result_type
Returns a new random integer.
static constexpr auto min() -> result_type
Returns the minimum random value this source can produce.
static constexpr auto max() -> result_type
Returns the maximum random value this source can produce.
auto operator=(random_source &&other)=delete
auto operator=(const random_source &other)=delete
random_source(const random_source &other)=delete
auto random_hash() -> hash_t
Returns a random 32-byte hash value.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.