Use sha1 for cache keys

This commit is contained in:
Chris Kankiewicz
2020-06-04 11:08:05 -07:00
parent 23ae169e52
commit 260620ee78
3 changed files with 3 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ class FileInfoController
}
$response->getBody()->write($this->cache->get(
sprintf('file-info-%s', md5($file->getRealPath())),
sprintf('file-info-%s', sha1($file->getRealPath())),
function () use ($file): string {
return json_encode(['hashes' => $this->calculateHashes($file)]);
}

View File

@@ -65,7 +65,7 @@ class ZipController
}
$response->getBody()->write(
$this->cache->get(sprintf('zip-%s', md5($path)), function () use ($path): string {
$this->cache->get(sprintf('zip-%s', sha1($path)), function () use ($path): string {
return $this->createZip($path)->getContents();
})
);

View File

@@ -32,7 +32,7 @@ class Markdown extends ViewFunction
public function __invoke(string $string): string
{
return $this->cache->get(
sprintf('markdown-%s', md5($string)),
sprintf('markdown-%s', sha1($string)),
function () use ($string): string {
return $this->parser->parse($string);
}