Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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 soffes added a commit that referenced this pull request Sep 14, 2012

@soffes soffes Merge pull request #134 from density/master
Replace arc4random() with arc4random_uniform() to improve randomness
af60a23

@soffes 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