Get a unique query checksum

@return integer
322282
private function _getQueryChecksum()
    {
        return md5(
            serialize(
                [
                    "name" => $this->getName(),
                    "entity" => Convention::classToName(
                        $this->reflection->getClassName(), Convention::ENTITY_MASK
                    ),
                    "limit" => $this->limit,
                    "offset" => $this->offset,
                    "selection" => $this->selection,
                    "orderBy" => $this->orderBy,
                    "adapterAssociations" => array_keys($this->adapterAssociations),
                    "remoteAssociations" => array_keys($this->remoteAssociations),
                    "conditions" => $this->filter
                ]
            )
        );
    }
460545
protected function calculateChecksum() {
        // Checksum
        // First Char (START)
        // + Starting with the first data character following the start character,
        // take the value of the character (between 0 and 102, inclusive) multiply
        // it by its character position (1) and add that to the running checksum.
        // Modulated 103
        $this->checksumValue = $this->indcheck[0];
        $c = count($this->indcheck);
        for ($i = 1; $i < $c; $i++) {
            $this->checksumValue += $this->indcheck[$i] * $i;
        }

        $this->checksumValue = $this->checksumValue % 103;
    }
707741
private function checksum($code)
	{
		$len = strlen($code);
		$sum = 0;
		for ($i = 0; $i < $len; $i += 2) {
			$sum += $code[$i];
		}
		$sum *= 3;
		for ($i = 1; $i < $len; $i += 2) {
			$sum += ($code[$i]);
		}
		$r = $sum % 10;
		if ($r > 0) {
			$r = (10 - $r);
		}
		return $r;
	}
1372748
public function hashCode()
    {
        if (null !== $this->getPrimaryKey()) {
            return crc32(serialize($this->getPrimaryKey()));
        }

        return crc32(serialize(clone $this));
    }
1094818
protected function calculateChecksum() {
        // Checksum
        // First CheckSUM "C"
        // The "C" checksum character is the modulo 11 remainder of the sum of the weighted
        // value of the data characters. The weighting value starts at "1" for the right-most
        // data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20.
        // After 10, the sequence wraps around back to 1.

        // Second CheckSUM "K"
        // Same as CheckSUM "C" but we count the CheckSum "C" at the end
        // After 9, the sequence wraps around back to 1.
        $sequence_multiplier = array(10, 9);
        $temp_text = $this->text;
        $this->checksumValue = array();
        for ($z = 0; $z < 2; $z++) {
            $c = strlen($temp_text);

            // We don't display the K CheckSum if the original text had a length less than 10
            if ($c <= 10 && $z === 1) {
                break;
            }

            $checksum = 0;
            for ($i = $c, $j = 0; $i > 0; $i--, $j++) {
                $multiplier = $i % $sequence_multiplier[$z];
                if ($multiplier === 0) {
                    $multiplier = $sequence_multiplier[$z];
                }

                $checksum += $this->findIndex($temp_text[$j]) * $multiplier;
            }

            $this->checksumValue[$z] = $checksum % 11;
            $temp_text .= $this->keys[$this->checksumValue[$z]];
        }
    }
171524
protected function getUniqueLoginKey()
    {
        $key = $this->request->input($this->loginKey);
        $ip = $this->request->ip();

        return \mb_strtolower($key).$ip;
    }
1249836
protected function getHash()
    {
        return md5(sprintf('%s %s %s %s',
            $this->getMethod(),
            $this->getPath(),
            json_encode($this->getHeaders()),
            json_encode($this->getQueryString())
        ));
    }
964498
public function getUniqueReference()
    {
        if ($this->uniqueReference === null) {
            $modelName = basename(str_replace("\\", "/", $this->getModelClassName()));

            if (!isset(self::$uniqueReferencesUsed[$modelName])) {
                self::$uniqueReferencesUsed[$modelName] = 0;
            }

            self::$uniqueReferencesUsed[$modelName]++;

            $this->uniqueReference = $modelName . (self::$uniqueReferencesUsed[$modelName] > 1 ? self::$uniqueReferencesUsed[$modelName] : "");
        }

        return $this->uniqueReference;
    }
657532
public function checkSysfolder()
    {
        $queryBuilder = Db::getQueryBuilder('pages');
        $page = $queryBuilder
            ->select('doktype')
            ->from('pages')
            ->where(
                $queryBuilder->expr()->eq(
                    'uid',
                    $queryBuilder->quote($this->id, \PDO::PARAM_INT)
                )
            )
            ->setMaxResults(1)
            ->execute()
            ->fetch(0);

        return $page['doktype'] == 254 ? true : false;
    }
1286808
public function unique()
    {
        $count = count($this->sfa);
        $unique = new SplFixedArray($count);
        $newCount = 0;
        $lastUnique = null;

        foreach ($this->sfa as $el) {
            for($i = $newCount; $i >= 0; $i--) {
                // going from back to forward to find sequence of duplicates faster
                if ($unique[$i] === $el) {
                    continue 2;
                }
            }
            $unique[$newCount++] = $el;
        }

        $unique->setSize($newCount);
        return new static($unique);
    }
1147801
protected function get_filepicker_unique_id() : string {
        if (empty($this->filepickeruniqueid)) {
            $this->filepickeruniqueid = uniqid();
        }
        return $this->filepickeruniqueid;
    }
289655
protected function generateCheckSum() {
        return sha1(
                        sprintf("%s|%s|%s|%s|%s|%s|%s", $this->_merchantID, $this->_secretCode, $this->data->ic_amount, $this->data->ic_orderid, $this->data->ic_reference, $this->data->ic_currency, $this->data->ic_country
                        )
        );
    }
425172
private function getDumpChecksum()
    {
        $dumpName = $this->getDumpName();
        $checksum = $this->getChecksum();

        return array_key_exists($dumpName, $checksum)? $checksum[$dumpName] : array();
    }
170231
private function getUniqueKey(): string
    {
        do {
            try {
                $isDuplicate = null;
                $key = random_bytes($this->getOpt(self::OPT_SESSION_KEY_LENGTH));

                // Ask for duplicate key from storage
                $this->emit('duplicate-check', [$key, &$isDuplicate]);

            } catch (\Exception $e) {
                throw new SessionException($e->getMessage(), SessionException::ERR_RANDOM_BYTES);
            }
        } while (isset($this->SESSION[$key]) || $isDuplicate === true);

        return $key;
    }
534956
public function getUniqueRequestId()
    {
        $cookies_str = '';
        foreach ($_COOKIE as $key => $val) {
            if (strpos($key, $this->getKey()) !== false) {
                $cookies_str .= $key . json_encode($val);
            }
        }

        return md5($cookies_str . $this->getKey() . json_encode($this->getInput()));
    }
1347467
protected function get_unique_db_instance_id() {
        global $CFG;

        $strkey = $CFG->dbname . ':' . $CFG->prefix;
        $intkey = crc32($strkey);
        // Normalize between 64 bit unsigned int and 32 bit signed ints. Php could return either from crc32.
        if (PHP_INT_SIZE == 8) {
            if ($intkey > 0x7FFFFFFF) {
                $intkey -= 0x100000000;
            }
        }

        return $intkey;
    }
873644
public function originalChecksums(array $checksums = null) {
        if ($checksums === null) {
            return $this->originalChecksums;
        }

        $this->originalChecksums = $checksums;

        return $this;
    }