generator: fix generate_random_data() function
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 01:09:24 +01:00
parent 879a8c69d3
commit 0bac9f83d3
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -157,10 +157,11 @@ auto Generator::generate_random_data(uint n) -> std::string {
try {
/* do magic to compute r
* r rst-n-bytes(GenerateBlocks(G, ceil(n/16) )) */
// n is number of bytes, i.e. pass n*8 to get number of bits
unsigned int how_many(static_cast<unsigned int>(ceil((n * 8) / 16)));
// fmt::print("how_many: {}\n", how_many); // debugging
* r first-n-bytes(GenerateBlocks(G, ceil(n/16) )) */
unsigned int how_many(
static_cast<unsigned int>(std::ceil(static_cast<double>(n) / 16)));
std::string rr{generate_blocks(how_many)};
fmt::print("rr (output from generate_blocks): {}\n", rr);