Skip to content

Commit

Permalink
Update based on review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Klemm authored and Tim Klemm committed Oct 22, 2024
1 parent 3f1402e commit 60ad141
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions system/globalid/lnuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,7 @@ namespace ln_uid {
{
// Should never happen, but if it does log it and fallback
OERRLOG("Could not read data from /dev/urandom");
auto randchar = []() -> char {
const char charset[] = "0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
const size_t max_index = (sizeof(charset) - 1);
return charset[static_cast<size_t>(rand()) % max_index];
};
std::generate_n(randomdata, random_byte_count, randchar);
std::generate_n(randomdata, random_byte_count, [](){ return char(rand()); });
}
if (fp)
fclose(fp);
Expand Down

0 comments on commit 60ad141

Please sign in to comment.