Re: Seeding random() randomly
Re: Seeding random() randomly
- Subject: Re: Seeding random() randomly
- From: David Duncan <email@hidden>
- Date: Thu, 26 May 2011 18:29:13 -0700
On May 26, 2011, at 6:15 PM, Dave Keck wrote:
> I'm not sure what your problem is, but I believe arc4random() has superseded random() for a while now.
Incorrect. There are many reason to have a seedable PRNG, the least of which is the ability to reasonably debug the randomness. That an arc4random() is meant for cryptographic security, and as such using it suffers a performance tradeoff.
As an example of "debugging the randomness" I recently created a graphical effect that relied heavily on random number generation. I needed to debug an issue that occurred 2 minutes into the sequence and relatively rare. The only reason I could reasonably debug the issue like this was because I had control over the sequence of numbers that I was seeing.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden