Skip to content

Commit cdb4ca7

Browse files
authored
Merge pull request #3 from open-source-contributions/use_random_int
Using random_int to generate cryptographic random
2 parents f917aa2 + f026d14 commit cdb4ca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generator/Passcode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function generate(int $length = self::DEFAULT_LENGTH): string
2020
{
2121
$code = [];
2222
for ($amount = 0; $amount < $length; $amount++) {
23-
$code[] = self::DIGITS[mt_rand(0, self::TOTAL_DIGITS)];
23+
$code[] = self::DIGITS[random_int(0, self::TOTAL_DIGITS)];
2424
}
2525

2626
return implode($code);

0 commit comments

Comments
 (0)