Skip to content

Commit

Permalink
Use mt_rand instead of random_int to generate random strings
Browse files Browse the repository at this point in the history
since no cryptographically secure random number generator is required

#934
  • Loading branch information
realodix committed Dec 17, 2023
1 parent 7229e18 commit 9442919
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Services/KeyGeneratorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getBytesFromString(string $alphabet, int $length): string

$result = '';
for ($i = 0; $i < $length; $i++) {
$result .= $alphabet[random_int(0, $stringLength - 1)];
$result .= $alphabet[mt_rand(0, $stringLength - 1)];
}

return $result;
Expand Down

0 comments on commit 9442919

Please sign in to comment.