diff --git a/src/Hasher/DefaultHasher.php b/src/Hasher/DefaultHasher.php index edf8c52..a2a47b5 100644 --- a/src/Hasher/DefaultHasher.php +++ b/src/Hasher/DefaultHasher.php @@ -17,7 +17,8 @@ public function getHashFor(Request $request): string { $cacheNameSuffix = $this->getCacheNameSuffix($request); - return 'responsecache-' . md5( + return 'responsecache-' . hash( + 'xxh128', "{$request->getHost()}-{$this->getNormalizedRequestUri($request)}-{$request->getMethod()}/$cacheNameSuffix" ); } diff --git a/tests/ResponseHasherTest.php b/tests/ResponseHasherTest.php index 03eae2e..aaf05dd 100644 --- a/tests/ResponseHasherTest.php +++ b/tests/ResponseHasherTest.php @@ -20,7 +20,7 @@ $this->cacheProfile->shouldReceive('useCacheNameSuffix')->andReturn('cacheProfileSuffix'); assertEquals( - 'responsecache-467d6e9cb7425ed9d3e114e44eb7117f', + 'responsecache-9937bec32aa1918917ad64b2b25f2982', $this->requestHasher->getHashFor($this->request) ); });