views:

79

answers:

1

What's the difference between arc4random and random?

+7  A: 

random is known to be predictable and thus not to be used for secure pseudo-random number generation. arc4random is a newer, less predictable pseudo-random number generator. If you are not using it for anything secure, random will work fine.

coneybeare
`random` is also significantly faster than `arc4random`, which is why you'd ever use it at all.
Colin Gislason
@Colin Cislason: How much faster? Does it make any difference if you aren't creating 1000nds of random numbers?
Emil
Colin Gislason