From f3e0c1a833fac6982d524df172ee61f220492d42 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 20 Mar 2025 02:48:10 +0500 Subject: feat: random file names --- lib/utils.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/utils.php b/lib/utils.php index b5f8431..af8cc2f 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -1,4 +1,6 @@ $message, 'data' => $data ]); +} + +function generate_random_char_sequence(array $chars, int $length): string +{ + $o = ""; + + for ($i = 0; $i < $length; $i++) { + $o .= $chars[random_int(0, count($chars) - 1)]; + } + + return $o; } \ No newline at end of file -- cgit v1.2.3