From 60ad141fc829b794c94b3cd626e41937da71897f Mon Sep 17 00:00:00 2001 From: Tim Klemm Date: Tue, 22 Oct 2024 13:49:48 -0400 Subject: [PATCH] Update based on review comments. --- system/globalid/lnuid.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/system/globalid/lnuid.cpp b/system/globalid/lnuid.cpp index a72a89542f1..c11d8be9732 100644 --- a/system/globalid/lnuid.cpp +++ b/system/globalid/lnuid.cpp @@ -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(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);