Vytvori md5 session checksum

@return string32 session checksum
494375
private static function make_checksum() {
        $ret = "";
        $_SESSION[__SESSION_time_var] = \AsyncWeb\Date\Time::get();
        if (isset($_SESSION) && is_array($_SESSION)) foreach ($_SESSION as $s => $v) {
            if ($s != __SESSION_checksum_var) {
                $ret = md5($ret . $s);
            }
        }
        Session::$checksum = $ret;
        return $ret;
    }
1338065
public function generateCacheKey(): string
    {
        $name = $this->getConnection()->getName();

        return \md5($name.$this->toSql().\serialize($this->getBindings()));
    }
405264
public function generateHash(): string
    {
        $h = sprintf('%s%s%s', (string)$this->getIdentificator(), $this->getExpiration(), $this->getSecret());
        $h = md5($h, true);
        $h = self::base64url_encode($h);
        return $h;
    }
886465
public function getHashCode()
    {
        if ($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5(
            $this->argb .
            __CLASS__
        );
    }
976788
public static function getAppHash()
    {
        $bs = self::getSingleton();
        $config = $bs->getConfig();
        $string = $bs->getAppName();
        $string .= $bs->getConfigFile();
        $string .= $bs->getDirectory();
        $string .= __FILE__;
        return substr(md5($string), 0, 16);
    }
818207
protected function get_settings_hash() {
        if (empty($this->settingshash)) {
            $this->settingshash = md5($this->dbhost . $this->dbuser . $this->dbname . $this->prefix);
        }
        return $this->settingshash;
    }
839164
public static function ezcrc32( $string )
    {
        $ini = eZINI::instance();

        if ( $ini->variable( 'SiteSettings', '64bitCompatibilityMode' ) === 'enabled' )
            $checksum = sprintf( '%u', crc32( $string ) );
        else
            $checksum = crc32( $string );

        return $checksum;
    }
230414
public function getHashCode()
    {
        if ($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5(
            $this->borderStyle .
            $this->color->getHashCode() .
            __CLASS__
        );
    }
723439
public function getHashCode() {
    	return md5(
    		  $this->_renderingFunction
    		. $this->_mimeType
    		. $this->_uniqueName
    		. parent::getHashCode()
    		. __CLASS__
    	);
    }
741927
public function getKey(): string
    {
        if ($this->key === null) {
            $this->key = md5($this->getContent());
        }
        return $this->key;
    }
1223885
public function stackTraceHashId()
    {
        if (!isset($this->stackTraceHashId)) {
            // take the lower 16 digits of the md5
            $md5 = md5(serialize($this->stackTrace));
            $this->stackTraceHashId = substr($md5, 16);
        }
        return $this->stackTraceHashId;
    }
892641
private function getHash()
    {
        return md5(implode('&', [
            'appkey=' . $this->parameters->getAuth('appkey'),
            'secret=' . $this->parameters->getAuth('secret'),
            'email=' . $this->parameters->getAuth('email'),
            'password=' . $this->parameters->getAuth('password'),
        ]));
    }
707126
public function getHashCode()
    {
        $hashConditionals = '';
        foreach ($this->conditionalStyles as $conditional) {
            $hashConditionals .= $conditional->getHashCode();
        }

        return md5(
            $this->fill->getHashCode() .
            $this->font->getHashCode() .
            $this->borders->getHashCode() .
            $this->alignment->getHashCode() .
            $this->numberFormat->getHashCode() .
            $hashConditionals .
            $this->protection->getHashCode() .
            ($this->quotePrefix  ? 't' : 'f') .
            __CLASS__
        );
    }
322293
function get_nonce() {
        if (!empty($this->nonce)) {
            $nonce = $this->nonce;
            unset($this->nonce);
            return $nonce;
        }
        $mt = microtime();
        $rand = mt_rand();

        return md5($mt . $rand);
    }
802012
public static function check_checksum() {
        if (!isset($_SESSION)) {
            return false;
        }
        if (!@$_SESSION[__SESSION_checksum_var]) {
            /**
             * Toto asi bude treba opravit, lebo ked niekto ma pristup k sesssion, a ju modifikuje, a zaroven zrusi checksum premennu tak si to system nevsimne
             *
             */
            return true;
        }
        if ((Session::$checksum == null && (Session::make_checksum() == @$_SESSION[__SESSION_checksum_var])) || (Session::$checksum != null && (Session::$checksum == @$_SESSION[__SESSION_checksum_var]))) {
            return true;
        } else {
            //  		echo "b"; exit;
            if (isset($_SESSION) && $_SESSION) {
                session_destroy();
                $_SESSION = array();
            }
            \AsyncWeb\Security\Auth::logout();
            if (class_exists('\AsyncWeb\Text\Messages')) {
                \AsyncWeb\Text\Messages::die_error(\AsyncWeb\System\Language::get("Session was modified outside of system!!!!"));
            } else {
                echo "killing sess.";
            }
            return false;
        }
    }
369504
protected function _getCnonce()
    {
        if ((@is_readable('/dev/urandom') &&
             ($fd = @fopen('/dev/urandom', 'r'))) ||
            (@is_readable('/dev/random') &&
             ($fd = @fopen('/dev/random', 'r')))) {
            $str = fread($fd, 32);
            fclose($fd);
        } else {
            $str = '';
            for ($i = 0; $i < 32; ++$i) {
                $str .= chr(mt_rand(0, 255));
            }
        }

        return base64_encode($str);
    }
1110119
function get_local_md5() {
        global $CFG;

    /// Check requisites are passed
        if (!$this->requisitesok) {
            return false;
        }

        $return_value = 'needtobeinstalled';   /// Fake value to force new installation

    /// Calculate source to read
       $source = $CFG->dataroot.'/'.$this->destpath.'/'.$this->componentname.'/'.$this->componentname.'.md5';
    /// Read md5 value stored (if exists)
       if (file_exists($source)) {
           if ($temp = file_get_contents($source)) {
               $return_value = $temp;
           }
        }
        return $return_value;
    }