aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/functions.php7
-rw-r--r--core/namespace/Application.php2
2 files changed, 1 insertions, 8 deletions
diff --git a/core/functions.php b/core/functions.php
index ef2814a..517be51 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -234,13 +234,6 @@ function removeWhitespace($string): string {
}
#===============================================================================
-# Return pseudo-random (hex converted) string
-#===============================================================================
-function getRandomValue($length = 40): string {
- return strtoupper(bin2hex(random_bytes(ceil($length / 2))));
-}
-
-#===============================================================================
# Return truncated string
#===============================================================================
function truncate($string, $length, $replace = '') {
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 64e562d..6a77865 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -72,7 +72,7 @@ class Application {
#===============================================================================
public static function getSecurityToken(): string {
if(!isset($_SESSION['token'])) {
- $_SESSION['token'] = getRandomValue();
+ $_SESSION['token'] = bin2hex(random_bytes(16));
}
return $_SESSION['token'];