diff options
Diffstat (limited to 'includes/util/random.inc')
-rw-r--r-- | includes/util/random.inc | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/includes/util/random.inc b/includes/util/random.inc deleted file mode 100644 index b6e7905..0000000 --- a/includes/util/random.inc +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * @throws Exception - */ -function random($length = 13): string { - if (function_exists("random_bytes")) { - $bytes = random_bytes(ceil($length / 2)); - } elseif (function_exists("openssl_random_pseudo_bytes")) { - $bytes = openssl_random_pseudo_bytes(ceil($length / 2)); - } else { - throw new Exception("No cryptographically secure random function available"); - } - return substr(bin2hex($bytes), 0, $length); -}
\ No newline at end of file |