1
0

First commit

This commit is contained in:
2020-04-29 23:58:18 +02:00
commit f3230a32ce
108 changed files with 77210 additions and 0 deletions

20
bootstrap/helpers.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* Create cryptographically secure tokens of custom length
*
* @author Scott https://stackoverflow.com/questions/1846202/php-how-to-generate-a-random-unique-alphanumeric-string/13733588#13733588
*/
function getToken($length){
$token = "";
$codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
$codeAlphabet.= "0123456789";
$max = strlen($codeAlphabet);
for ($i=0; $i < $length; $i++) {
$token .= $codeAlphabet[random_int(0, $max-1)];
}
return $token;
}