kernel update
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user