Replace arc4random() with arc4random_uniform() to improve randomness #134

Merged
merged 1 commit into from Sep 14, 2012

Conversation

Projects
None yet
2 participants
Contributor

density commented Sep 12, 2012

Using arc4random() % [self count] to choose an object will generate biased results when the array length is not a power of 2. Switching to arc4random_uniform() fixes this.

Owner

soffes commented Sep 14, 2012

Good call!

soffes merged commit af60a23 into soffes:master Sep 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment