• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Seeding random() randomly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Seeding random() randomly (From: Graham Cox <email@hidden>)
 >Re: Seeding random() randomly (From: Dave Keck <email@hidden>)

  • Prev by Date: Re: Seeding random() randomly
  • Next by Date: Re: Seeding random() randomly
  • Previous by thread: Re: Seeding random() randomly
  • Next by thread: Re: Seeding random() randomly
  • Index(es):
    • Date
    • Thread