1)//Generating a simple random number
int random = random();
2)//A list of random number
int generated;
for (int i =0; i<10 br="br" i="i">generated = abs(100000*(random()));
NSLog(@”New Random Key: %d”,generated);
}
3)//Real Randomness :
srandom(time(NULL));
int generated;
for (int i =0; i<10 br="br" i="i">generated = abs(100000*(random()));
NSLog(@”New Random Key: %d”,generated);
}
4)Best One
arc4random()
It seems to be more popular and improves generation with unique-randoms.10>10>
No comments:
Post a Comment