X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/41f33f9c1dac5381412bcab57c971fd08d1d8613..a4111660b05af9df96bbe567aa43acff34b6339d:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index cfb2703..f2a26e0 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -101,6 +101,19 @@ function jirafeau_gen_random($l) return $code; } +function jirafeau_gen_download_pass($length, $allowed_chars) +{ + if ($length <= 0) { + return false; + } + $pass=""; + for ($i = 0; $i < $length; $i++) { + $pass .= $allowed_chars[rand(0, strlen($allowed_chars) - 1)]; + } + + return $pass; +} + function is_ssl() { if (isset($_SERVER['HTTPS'])) {