kernel update

This commit is contained in:
2024-12-18 12:46:57 +03:00
parent 653e0bc983
commit 4ff9fa9ad3
56 changed files with 1023 additions and 84 deletions

View File

@ -32,7 +32,7 @@ class TokenService
*/
public static function md5(): string
{
return md5(microtime() . self::getSalt() . time());
return md5(microtime() . self::getSalt(10) . time());
}
/**
@ -40,7 +40,7 @@ class TokenService
*/
public static function crypt(): string
{
return crypt(microtime(), self::getSalt());
return crypt(microtime(), self::getSalt(20));
}
/**
@ -48,15 +48,15 @@ class TokenService
*/
public static function hash(string $alg): string
{
return hash($alg, self::getSalt());
return hash($alg, self::getSalt(10));
}
/**
* @throws RandomException
*/
public static function getSalt(): string
public static function getSalt(int $length): string
{
return bin2hex(random_bytes(10));
return bin2hex(random_bytes($length));
}
}