site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In message <9A1D3A66-FE05-4F2B-BDCC-58A1D829339A@themactionfaction.com>, "A.M." writes:
srandrom() doesn't really care about the actual time- you should just make sure you seed with the least-significant 32-bits
Exactly.
int32_t seed=(int32_t)(time(NULL) & 0xff); srandom(seed);
That seems more like the least-significant 8 bits. Note that strictly speaking, seeding srandom with time may not be exactly secure, but then, srandom's not a cryptographically secure RNG anyway. -s _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com