do not re-seed random generator for each random id

This commit is contained in:
narspt 2023-01-31 20:41:04 +00:00 committed by GitHub
parent 7f4f23610e
commit 43369f6251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,6 @@ function FormatSeconds($seconds) {
function CreateCode ($laenge) {
$zeichen = "1234567890abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNAOPQRSTUVWYXZ";
mt_srand( (double) microtime() * 1000000);
$out = "";
for ($i=1;$i<=$laenge;$i++){
$out .= $zeichen[mt_rand(0,(strlen($zeichen)-1))];
@ -60,4 +59,4 @@ function CreateCode ($laenge) {
return $out;
}
?>
?>