mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Refactor Crypto::randomDigits()
This commit is contained in:
parent
29c0473b64
commit
940884e4bd
2 changed files with 3 additions and 11 deletions
|
@ -306,13 +306,6 @@ class Crypto
|
|||
*/
|
||||
public static function randomDigits($digits)
|
||||
{
|
||||
$rn = '';
|
||||
|
||||
// generating cryptographically secure pseudo-random integers
|
||||
for ($i = 0; $i < $digits; $i++) {
|
||||
$rn .= random_int(0, 9);
|
||||
}
|
||||
|
||||
return (int) $rn;
|
||||
return random_int(0, 10 ** $digits - 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue