mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-10-26 05:50:01 +00:00
Avoid modulo bias for PIN generation
This commit is contained in:
1 parent
46b9f84a31
commit
e0bb48320f
1 file changed
+2
-2
@@ -229,8 +229,8 @@
|
|||||||
|
|
||||||
- (NSString*) generatePIN {
|
- (NSString*) generatePIN {
|
||||||
NSString* PIN = [NSString stringWithFormat:@"%d%d%d%d",
|
NSString* PIN = [NSString stringWithFormat:@"%d%d%d%d",
|
||||||
arc4random() % 10, arc4random() % 10,
|
arc4random_uniform(10), arc4random_uniform(10),
|
||||||
arc4random() % 10, arc4random() % 10];
|
arc4random_uniform(10), arc4random_uniform(10)];
|
||||||
return PIN;
|
return PIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user