From 7f4f23610e2d59b1e5a314f63910c187cbcea1ab Mon Sep 17 00:00:00 2001 From: narspt Date: Tue, 31 Jan 2023 20:33:46 +0000 Subject: [PATCH 1/2] do not re-seed random generator for each random id --- dashboard/pgs/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dashboard/pgs/functions.php b/dashboard/pgs/functions.php index 74be9ee..32150b3 100755 --- a/dashboard/pgs/functions.php +++ b/dashboard/pgs/functions.php @@ -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))]; @@ -153,4 +152,4 @@ function kbytes_to_string($kb) { } -?> \ No newline at end of file +?> From 43369f6251146a46e87f03dc7942623ea613c111 Mon Sep 17 00:00:00 2001 From: narspt Date: Tue, 31 Jan 2023 20:41:04 +0000 Subject: [PATCH 2/2] do not re-seed random generator for each random id --- dashboard2/pgs/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dashboard2/pgs/functions.php b/dashboard2/pgs/functions.php index be10a94..a90af8c 100644 --- a/dashboard2/pgs/functions.php +++ b/dashboard2/pgs/functions.php @@ -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; } -?> \ No newline at end of file +?>