DreamPearl commented on a change in pull request #340:
URL: https://github.com/apache/qpid-proton/pull/340#discussion_r756929816
##########
File path: cpp/src/uuid.cpp
##########
@@ -38,20 +43,17 @@
namespace proton {
namespace {
-
-
-// Seed the random number generated once at startup.
-struct seed {
- seed() {
- // A hash of time and PID, time alone is a bad seed as programs started
- // within the same second will get the same seed.
- unsigned long secs = time(0);
- unsigned long pid = GETPID();
- std::srand(((secs*181)*((pid-83)*359))%104729);
- }
-} seed_;
-
-}
+// A hash of time, PID and random_device, time alone is a bad seed as programs
+// started within the same second will get the same seed.
Review comment:
Yeah, my bad! It was in nanoseconds. Updated the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]