Generate a cache id for the query cache - reusing the Result-Cache-Id generator.

@return string
197773
protected function getQueryCacheId()
    {
        ksort($this->hints);

        $platform = $this->getEntityManager()
            ->getConnection()
            ->getDatabasePlatform()
            ->getName();

        return md5(
            $this->getDQL() . serialize($this->hints) .
            '&platform=' . $platform .
            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') .
            '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults .
            '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
        );
    }
1276528
public function machine_id()
    {
        // check stmp path
        if (!file_exists($this->tmp_path.'/system')) {
            mkdir($this->tmp_path.'/system', 0755, true);
        }

        // file already generated
        if (file_exists($this->tmp_path.'/system/machine-id')) {
            return file_get_contents($this->tmp_path.'/system/machine-id');
        }

        if (file_exists('/var/lib/dbus/machine-id')) {
            $id = trim(`cat /var/lib/dbus/machine-id`);
            file_put_contents($this->tmp_path.'/system/machine-id', $id);
            return $id;
        }

        if (file_exists('/etc/machine-id')) {
            $id = trim(`cat /etc/machine-id`);
            file_put_contents($this->tmp_path.'/system/machine-id', $id);
            return $id;
        }

        $id = sha1(uniqid(true));
        file_put_contents($this->tmp_path.'/system/machine-id', $id);
        return $id;
    }
109014
protected function generateCacheKey(): string
    {
        return sprintf(
            '%s:%s:%s',
            $this->command,
            $this->collection->getNamespace(),
            md5(serialize($this->params))
        );
    }
1288603
public function getQueryCacheDriver()
    {
        if (!$this->queryCacheDriver instanceof CacheProvider) {
            $this->queryCacheDriver = $this->getCacheDriver(
                (string) $this->getOption('query_cache_namespace'),
                $this->getOption('query_cache_driver')
            );
        }

        return $this->queryCacheDriver;
    }
1021001
public function sampleId()
    {
        if (!$this->sampleId) {
            $this->sampleId = $this->inputId() ?: $this->generateSampleId();
        }

        return $this->sampleId;
    }
119753
def prepare_cache_id(self, combined_args_kw):
        ""
        cache_id = "".join(self.id(a) for a in combined_args_kw)
        return cache_id
336272
public static function generateId()
    {
        while ($rand = rand(1, PHP_INT_MAX)) {
            if (!in_array($rand, static::$generatedIds, true)) {
                static::$generatedIds[] = $rand;
                return $rand;
            }
        }
    }
155312
function Generate()
    {
        if ($this->cacher->MustUseCache())
        {
            $this->xml = $this->cacher->GetFromCache();
            return;
        }
        $this->AddAllPages();
        $this->xml = $this->sitemap->SaveXml();
        if ($this->cacher->MustStoreToCache())
        {
            $this->cacher->StoreToCache($this->xml);
        }
    }
584839
public function getGenerator()
    {
        if (null !== $this->generator) {
            return $this->generator;
        }

        $compiled = is_a($this->options['generator_class'], CompiledUrlGenerator::class, true) && UrlGenerator::class === $this->options['generator_base_class'];

        if (null === $this->options['cache_dir'] || null === $this->options['generator_cache_class']) {
            $routes = $this->getRouteCollection();
            if ($compiled) {
                $routes = (new CompiledUrlGeneratorDumper($routes))->getCompiledRoutes();
            }
            $this->generator = new $this->options['generator_class']($routes, $this->context, $this->logger, $this->defaultLocale);
        } else {
            $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['generator_cache_class'].'.php',
                function (ConfigCacheInterface $cache) {
                    $dumper = $this->getGeneratorDumperInstance();

                    $options = [
                        'class' => $this->options['generator_cache_class'],
                        'base_class' => $this->options['generator_base_class'],
                    ];

                    $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources());
                }
            );

            if ($compiled) {
                $this->generator = new $this->options['generator_class'](require $cache->getPath(), $this->context, $this->logger);
            } else {
                if (!class_exists($this->options['generator_cache_class'], false)) {
                    require_once $cache->getPath();
                }

                $this->generator = new $this->options['generator_cache_class']($this->context, $this->logger, $this->defaultLocale);
            }
        }

        if ($this->generator instanceof ConfigurableRequirementsInterface) {
            $this->generator->setStrictRequirements($this->options['strict_requirements']);
        }

        return $this->generator;
    }
961590
public function getId()
    {
        if (null === $this->id) {
            $this->setId($this->getHostname() . ':' . $this->getProcess()->getPid() . ':' . implode(',', $this->queues));
        }

        return $this->id;
    }
401036
public function getRequestId()
    {
        if ($this->requestId == null) {
            $this->requestId = $this->generateRequestId();
        }

        return $this->requestId;
    }
830278
public function getID(): ?string
    {
        $sessionKey = $this->getSessionKey();
        if (strlen($sessionKey) === 0) {
            return null;
        }
        $cacheKey = 'id-' . $sessionKey;
        if (!isset(self::$cache[$cacheKey])) {
            self::$cache[$cacheKey] = null;
            $data = Internal\Data::getValue('.temp/bearcms/userkeys/' . md5($sessionKey));
            if ($data !== null) {
                self::$cache[$cacheKey] = $data;
            }
        }
        return self::$cache[$cacheKey];
    }
1071774
protected function getId()
    {
        if (! isset($_COOKIE[self::COOKIE_ID])) {
            $id = uniqid();
            setcookie(self::COOKIE_ID, $id);
        } else {
            $id = $_COOKIE[self::COOKIE_ID];
        }
        return $id;
    }
1334791
protected function generateId(): int
    {
        if ($this->getId() !== null) {
            return $this->getId();
        }

        $maxIdLength = \mb_strlen((string) PHP_INT_MAX) - 1;

        // try generate unique id for file
        $id = mb_substr(crc32($this->getModelId()), $maxIdLength - self::ID_PATH_HASH_LENGTH)
            . mb_substr(crc32($this->getActualPath()), self::ID_PATH_HASH_LENGTH);

        return (int) $id;
    }
1338065
public function generateCacheKey(): string
    {
        $name = $this->getConnection()->getName();

        return \md5($name.$this->toSql().\serialize($this->getBindings()));
    }
472143
public function getId()
    {
        if (!$this->id) {
            $this->setId(sha1($this->getDomain() . $this->getKey()));
        }

        return $this->id;
    }
816122
public function id() {
		$res = $this->_match;
		$count = count($res);

		if (empty($this->_stub['id'])) {
			if (empty($res[$count - 1])) {
				return '';
			}
			$this->_stub['id'] = $res[$count - 1];
		}
		$id = $this->_stub['id'];

		for ($i = 1; $i <= $count; $i++) {
			$id = str_ireplace('$' . $i, $res[$i - 1], $id);
		}
		return $id;
	}