accumulator: use const& params,uint->unsigned int
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b4d7cb3dfb
commit
146bf14d68
|
@ -14,7 +14,7 @@
|
|||
namespace fortuna {
|
||||
namespace accumulator {
|
||||
|
||||
auto wait_for(uint milliseconds) -> void {
|
||||
auto wait_for(const unsigned int& milliseconds) -> void {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ auto Accumulator::set_gen(fortuna::generator::Generator& gen) -> void {
|
|||
this->Gen = std::move(&gen);
|
||||
}
|
||||
|
||||
auto Accumulator::get_random_data(uint n_bytes) -> std::string {
|
||||
auto Accumulator::get_random_data(const unsigned int& n_bytes) -> std::string {
|
||||
std::string data{""};
|
||||
try {
|
||||
data = this->Gen->generate_random_data(n_bytes);
|
||||
|
|
|
@ -22,13 +22,13 @@ private:
|
|||
fortuna::generator::Generator* Gen;
|
||||
|
||||
protected:
|
||||
uint src_count{0};
|
||||
unsigned int src_count{0};
|
||||
|
||||
public:
|
||||
constexpr static const unsigned int init_pool_num{0};
|
||||
|
||||
auto add_source() -> void {
|
||||
static uint src_id{this->src_count};
|
||||
[[maybe_unused]] auto add_source() -> void {
|
||||
static unsigned int src_id{this->src_count};
|
||||
// make really sure we don't add a duplicate src_id
|
||||
if (src_id <= this->MAX_SOURCES &&
|
||||
!src_is_registered(static_cast<uint8_t>(src_id))) {
|
||||
|
@ -45,15 +45,15 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
auto src_is_registered(const uint8_t& id) -> bool;
|
||||
[[maybe_unused]] auto src_is_registered(const uint8_t& id) -> bool;
|
||||
|
||||
auto set_gen(fortuna::generator::Generator& Gen) -> void;
|
||||
|
||||
auto get_random_data(uint n_bytes) -> std::string;
|
||||
auto get_random_data(const unsigned int& n_bytes) -> std::string;
|
||||
|
||||
auto call_reseed(const std::string& seed) -> void;
|
||||
|
||||
auto wait_for(uint milliseconds) -> void;
|
||||
auto wait_for(const unsigned int& milliseconds) -> void;
|
||||
|
||||
// spawns the entropy_collector_service and pools_service threads
|
||||
auto accumulator_service() -> int;
|
||||
|
|
Reference in New Issue