We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20ba56d commit 8aba3aeCopy full SHA for 8aba3ae
src/Utils/Tools.php
@@ -186,7 +186,8 @@ public static function genRandomChar(int $length = 8): string
186
$length = 2;
187
}
188
189
- return bin2hex(openssl_random_pseudo_bytes($length / 2));
+ $randomString = bin2hex(openssl_random_pseudo_bytes((int) ceil($length / 2)));
190
+ return substr($randomString, 0, $length);
191
192
193
public static function genSs2022UserPk(string $passwd, string $method): string|false
0 commit comments