PHPPM\Utils::generateSessionId PHP Метод

generateSessionId() публичный статический Метод

Generates stronger session ids for session handling.
public static generateSessionId ( ) : string
Результат string
    public static function generateSessionId()
    {
        $entropy = '';
        $entropy .= uniqid(mt_rand(), true);
        $entropy .= microtime(true);
        if (function_exists('openssl_random_pseudo_bytes')) {
            $entropy .= openssl_random_pseudo_bytes(32, $strong);
        }
        if (function_exists('mcrypt_create_iv')) {
            $entropy .= mcrypt_create_iv(32, MCRYPT_DEV_URANDOM);
        }
        $hash = hash('whirlpool', $entropy);
        return $hash;
    }