Encode parameters to generate a hash.

@return string
192498
public function encode()
    {
        $ret = '';
        $numbers = func_get_args();

        if (func_num_args() == 1 && is_array(func_get_arg(0))) {
            $numbers = $numbers[0];
        }

        if (!$numbers) {
            return $ret;
        }

        foreach ($numbers as $number) {
            $isNumber = ctype_digit((string)$number);

            if (!$isNumber) {
                return $ret;
            }
        }

        $alphabet = $this->alphabet;
        $numbersSize = count($numbers);
        $numbersHashInt = 0;

        foreach ($numbers as $i => $number) {
            $numbersHashInt += Math::intval(Math::mod($number, ($i + 100)));
        }

        $lottery = $ret = $alphabet[$numbersHashInt % strlen($alphabet)];
        foreach ($numbers as $i => $number) {
            $alphabet = $this->shuffle($alphabet, substr($lottery . $this->salt . $alphabet, 0, strlen($alphabet)));
            $ret .= $last = $this->hash($number, $alphabet);

            if ($i + 1 < $numbersSize) {
                $number %= (ord($last) + $i);
                $sepsIndex = Math::intval(Math::mod($number, strlen($this->seps)));
                $ret .= $this->seps[$sepsIndex];
            }
        }

        if (strlen($ret) < $this->minHashLength) {
            $guardIndex = ($numbersHashInt + ord($ret[0])) % strlen($this->guards);

            $guard = $this->guards[$guardIndex];
            $ret = $guard . $ret;

            if (strlen($ret) < $this->minHashLength) {
                $guardIndex = ($numbersHashInt + ord($ret[2])) % strlen($this->guards);
                $guard = $this->guards[$guardIndex];

                $ret .= $guard;
            }
        }

        $halfLength = (int)(strlen($alphabet) / 2);
        while (strlen($ret) < $this->minHashLength) {
            $alphabet = $this->shuffle($alphabet, $alphabet);
            $ret = substr($alphabet, $halfLength) . $ret . substr($alphabet, 0, $halfLength);

            $excess = strlen($ret) - $this->minHashLength;
            if ($excess > 0) {
                $ret = substr($ret, $excess / 2, $this->minHashLength);
            }
        }

        return $ret;
    }
69384
protected function encodeContents()
    {
        $serverIDEncoded = StringType::write($this->serverID);

        $encodedPublicKey = base64_decode($this->getPublicKey());
        $publicKeyLength = VarInt::writeUnsignedVarInt(strlen($encodedPublicKey));

        $encodedToken = $this->getToken();
        $tokenLength = VarInt::writeUnsignedVarInt(strlen($encodedToken));

        return $serverIDEncoded->getEncoded() . $publicKeyLength->getEncoded() . $encodedPublicKey . $tokenLength->getEncoded() . $encodedToken;
    }
1354139
public function _encode()
    {
        $out = array();
        if ($this->objectId)
        {
            $out['objectId'] = $this->objectId;
        }
        if ($this->createdAt)
        {
            $out['createdAt'] = $this->createdAt;
        }
        if ($this->updatedAt)
        {
            $out['updatedAt'] = $this->updatedAt;
        }
        foreach ($this->serverData as $key => $value)
        {
            $out[$key] = $value;
        }
        foreach ($this->estimatedData as $key => $value)
        {
            if (is_object($value) && $value instanceof \Avos\Internal\Encodable)
            {
                $out[$key] = $value->_encode();
            } else if (is_array($value))
            {
                $out[$key] = array();
                foreach ($value as $item)
                {
                    if (is_object($item) && $item instanceof \Avos\Internal\Encodable)
                    {
                        $out[$key][] = $item->_encode();
                    } else
                    {
                        $out[$key][] = $item;
                    }
                }
            } else
            {
                $out[$key] = $value;
            }
        }

        return json_encode($out);
    }
684575
public function generateSecret()
    {
        $secret = bin2hex(random_bytes(20));
        $this->secret = password_hash($secret, PASSWORD_DEFAULT);

        return $secret;
    }
571093
public function hashCode()
    {
        $validPk = null !== $this->getStructureNodeId() &&
            null !== $this->getParentId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation structure_node_parent_fk_node to table kk_trixionary_structure_node
        if ($this->aStructureNodeRelatedByStructureNodeId && $hash = spl_object_hash($this->aStructureNodeRelatedByStructureNodeId)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation structure_node_parent_fk_parent to table kk_trixionary_structure_node
        if ($this->aStructureNodeRelatedByParentId && $hash = spl_object_hash($this->aStructureNodeRelatedByParentId)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
532304
private function generateRequestParams() {
		$request_params = [
			'query' => [
				'ip'        => $this->ip,
				'license'   => $this->license,
			],
			'headers' => [
				'Geot-Nonce'  => urlencode(base64_encode(makeRandomString())),
				'Geot-Origin' => $_SERVER['HTTP_HOST']
			]
		];

		$base_string = json_encode($request_params);
		$request_params['query']['signature'] = urlencode(hash_hmac('sha256',$base_string, $this->api_secret ));
		return $request_params;
	}
1372748
public function hashCode()
    {
        if (null !== $this->getPrimaryKey()) {
            return crc32(serialize($this->getPrimaryKey()));
        }

        return crc32(serialize(clone $this));
    }
1201688
public function buildHash(): string
    {
        $hash = Crypt::hash(serialize($this), true);
        $this->lastBuildedHash = $hash;
        return $hash;
    }
1249836
protected function getHash()
    {
        return md5(sprintf('%s %s %s %s',
            $this->getMethod(),
            $this->getPath(),
            json_encode($this->getHeaders()),
            json_encode($this->getQueryString())
        ));
    }
465547
private function generateHash()
    {
        $this->hash = hash('md5', serialize(array(
            strval($this->getMinute()),
            strval($this->getHour()),
            strval($this->getDayOfMonth()),
            strval($this->getMonth()),
            strval($this->getDayOfWeek()),
            strval($this->getCommand()),
        )));

        return $this;
    }
360126
public function generateSigninInput()
    {
        $base64payload = $this->encoder->encode(json_encode($this->getPayload(), JSON_UNESCAPED_SLASHES));
        $base64header = $this->encoder->encode(json_encode($this->getHeader(), JSON_UNESCAPED_SLASHES));

        return sprintf('%s.%s', $base64header, $base64payload);
    }
690951
protected function generate()
    {
        $hash = bin2hex(random_bytes(16));

        $timeHi = hexdec(substr($hash, 12, 4)) & 0x0fff;
        $timeHi &= ~(0xf000);
        $timeHi |= 4 << 12;

        $clockSeqHi = hexdec(substr($hash, 16, 2)) & 0x3f;
        $clockSeqHi &= ~(0xc0);
        $clockSeqHi |= 0x80;

        $params = [substr($hash, 0, 8), substr($hash, 8, 4), sprintf('%04x', $timeHi), sprintf('%02x', $clockSeqHi), substr($hash, 18, 2), substr($hash, 20, 12)];

        return vsprintf('%08s-%04s-%04s-%02s%02s-%012s', $params);
    }
411929
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__
        );
    }
729247
public function hashCode()
    {
        $validPk = null !== $this->getCategoryId() &&
            null !== $this->getMediaId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation c2m_fk_904832 to table category
        if ($this->aCategory && $hash = spl_object_hash($this->aCategory)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation c2m_fk_32dfd1 to table media
        if ($this->aMedia && $hash = spl_object_hash($this->aMedia)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
1266439
protected function _encodeParameters($parameters, $keyPrefix = null)
    {
        if (!is_array($parameters) && !is_object($parameters)) {
            return $this->_urlencode($parameters);
        }

        $encodedData = array();

        foreach ($parameters as $key => $value) {
            $encodedKey = is_null($keyPrefix)
                ? $this->_urlencode($key)
                : $keyPrefix . '[' . $this->_urlencode($key) . ']';

            if (is_array($value) || is_object($value)) {
                $encodedData[] = $this->_encodeParameters($value, $encodedKey);
            } else {
                $encodedData[] = $encodedKey . '=' . $this->_urlencode($value);
            }
        }

        return implode('&', $encodedData);
    }
697128
private function generateToken()
    {
        return Hash::hash256(self::getHa1()->getHash(), $this->getNonce(), $this->getRounds());
    }
1364967
public function getHash(): ?string
    {
        if (!$this->_hash) {
            $this->_hash = $this->generateHash();
        }

        return $this->_hash;
    }