Generate cache filename

@return string md5
548517
public function strategy()
    {
        //when session support is enabled add that to file name
        $session_str = SessionHandler::process();

        $uri = empty($_SERVER['REQUEST_URI']) ? 'uri' : $_SERVER['REQUEST_URI'];
        $query = empty($_SERVER['QUERY_STRING']) ? 'query' : $_SERVER['QUERY_STRING'];

        return md5($uri . $_SERVER['SCRIPT_NAME'] . $query . $session_str);
    }
1211725
private static function _getFileNameForCacheId($cacheId)
    {
        $cacheId = preg_replace('#[^a-zA-Z0-9_-]#', '_', $cacheId);
        if (strlen($cacheId) > 50) {
            $cacheId = substr($cacheId, 0, 50).md5($cacheId);
        }
        return "cache/view/".self::CACHE_VERSION.'-'.$cacheId;
    }
1003203
public function generate(): string
    {
        $uniqueId = uniqid((string) rand(), true);

        return (string) md5($uniqueId);
    }
1009262
public function generateCacheFilePath($fileID, $add_parameters = false)
    {
        if (empty($this->cache_extension)) {
            $this->cache_extension = config('images.cache_extension');
        }

        /* To do: fileID should be better secured */
        $fileID = str_replace('.', '', $fileID);

        $parameters = ['i'];
        if ($add_parameters) {
            if ($this->size()) {
                $parameters[] = $this->size();
            }
            if ($this->watermarkPath()) {
                $parameters[] = 'w-'.md5($this->watermarkPath());
            }
        }
        $path = config('images.cache_path');
        $path .= "images/{$fileID}/".implode('-', $parameters);
        $path .= '.'.$this->cache_extension;

        return $path;
    }
787041
public function getFilesHashKey()
    {
        $file_locker = [];
        // $config = $this->config['config_root'].'/config.php';
        // $file_config = [];
        // $file = @$this->fileSys->getContent($this->config['config_root'].'/config.php');
        // $file_config[] = $file['setting'];
        $files_source = $this->fileSys->getFiles($this->source_dir);
        $files_themes = $this->fileSys->getFiles($this->themes_dir);
        $files = array_merge($files_source, $files_themes);
        foreach ($files as $file) {
            $file_locker[] = md5_file($file['file_path']);
        }
        return $file_locker;
    }
372157
protected function generateBasename()
    {
        $filename = md5($this->image . $this->height . $this->width);

        if (isset(static::$config['default_extension'])) {

            $extension = static::$config['default_extension'];

        } else {

            $extension = pathinfo($this->image, PATHINFO_EXTENSION);

        }

        return $filename . '.' . $extension;   
    }
6412
private function filename($name) {
        $name	=	md5(C('DATA_CACHE_KEY').$name);
        if(C('DATA_CACHE_SUBDIR')) {
            // 使用子目录
            $dir   ='';
            for($i=0;$i<C('DATA_PATH_LEVEL');$i++) {
                $dir	.=	$name{$i}.'/';
            }
            if(!is_dir($this->options['temp'].$dir)) {
                mkdir($this->options['temp'].$dir,0755,true);
            }
            $filename	=	$dir.$this->options['prefix'].$name.'.php';
        }else{
            $filename	=	$this->options['prefix'].$name.'.php';
        }
        return $this->options['temp'].$filename;
    }
1102960
public function getCacheDirname()
    {
        $tmp_dir = Helper::getOption('cache_directory');
        if (empty($tmp_dir)) {
            $tmp_dir = sys_get_temp_dir();
        }
        return rtrim($tmp_dir, '/').'/';
    }
787972
protected function _getCacheId($prefix = 'minify')
    {
        $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', $this->selectionId);
        $name = preg_replace('/\\.+/', '.', $name);
        $name = substr($name, 0, 100 - 34 - strlen($prefix));
        $md5 = md5(serialize(array(
            Minify_SourceSet::getDigest($this->sources),
            $this->options['minifiers'],
            $this->options['minifierOptions'],
            $this->options['postprocessor'],
            $this->options['bubbleCssImports'],
            Minify::VERSION,
        )));

        return "{$prefix}_{$name}_{$md5}";
    }
564855
private function getFileName($key) {
		$key = str_replace(' ', '', $key);
		$cacheDir = rtrim($this->cachePath, '\\/') . '/';
		if ($this->directoryLevel > 0) {
			$hash = abs(crc32($key));
			$cacheDir .= $hash % 1024;
			for($i = 1; $i < $this->directoryLevel; ++$i) {
				if (($prefix = substr($hash, $i, 2)) !== false) {
					$cacheDir .= '/' . $prefix;
				}
			}
		}
		return $cacheDir . '/' . md5($key) . $this->cacheExt;
	}
514791
public function getUniqueHashForFile()
    {
        $path = $this->fileInfo->getPath();
        $file = $this->fileInfo->getName();
        $mtime = $this->fileInfo->getModificationTime();

        return md5($path . $file . '-' . $mtime);
    }
26027
private function _generateKey()
    {
        if ($this->_key == '') {
            $this->_key = pack(
                'H*',
                hash('SHA256', md5(uniqid()))
            );
        }

        return $this->_key;
    }
523774
public function generate_single_key_prefix() {
        if ($this->keyprefixsingle === null) {
            $this->keyprefixsingle = $this->mode.'/'.$this->component.'/'.$this->area;
            $this->keyprefixsingle .= '/'.$this->get_cache_identifier();
            $identifiers = $this->get_identifiers();
            if ($identifiers) {
                foreach ($identifiers as $key => $value) {
                    $this->keyprefixsingle .= '/'.$key.'='.$value;
                }
            }
            $this->keyprefixsingle = md5($this->keyprefixsingle);
        }
        return $this->keyprefixsingle;
    }
751132
protected function _new_key()
	{
		$key = '';
		while (strlen($key) < 32)
		{
			$key .= mt_rand(0, mt_getrandmax());
		}
		return md5($this->config['cache_id'].'_'.uniqid($key, TRUE));
	}
273039
public function getCacheKey()
  {
    if (!$this->useCache) {
      return false;
    }
    $h = $this->sub;
    $h .= $this->assertionType;
    $h .= $this->privateKey;
    $h .= $this->scopes;
    $h .= $this->serviceAccountName;
    return md5($h);
  }
466900
private function generateNewFilename()
    {
        $time = time();
        $filename = $this->filename;
        $ext =  end(explode(".", $filename));
        do {
            $filename = substr(md5($filename. $time), 0, 8) . '.' . $ext;
        } while (file_exists($this->uploadDirectory . DIRECTORY_SEPARATOR . $filename));
        return $filename;
    }
383549
public function generateCacheId(\Exception $exception)
    {
        return md5(get_class($exception) . $exception->getFile() . $exception->getLine());
    }