summaryrefslogtreecommitdiff
path: root/includes/random.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
committerMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
commit108525534c28013cfe1897c30e4565f9893f3766 (patch)
treedd3e5132971f96ab5f05e7f3f8f6dbbf379a19bd /includes/random.php
parent2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab (diff)
downloadpluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.gz
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.bz2
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.zip
Update
Diffstat (limited to 'includes/random.php')
-rw-r--r--includes/random.php15
1 files changed, 0 insertions, 15 deletions
diff --git a/includes/random.php b/includes/random.php
deleted file mode 100644
index b6e7905..0000000
--- a/includes/random.php
+++ /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