Skip to content

Commit 8a68c67

Browse files
Use SHA-256 instead of MD5 to generate cache keys for static analysis cache (as SHA-256 is significantly faster than MD5 with PHP >= 8.4 on modern CPUs)
1 parent 81ce526 commit 8a68c67

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog-12.1.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
44

5+
## [12.1.3] - 2025-MM-DD
6+
7+
### Changed
8+
9+
* Use SHA-256 instead of MD5 to generate cache keys for static analysis cache (as SHA-256 is significantly faster than MD5 with PHP >= 8.4 on modern CPUs)
10+
511
## [12.1.2] - 2025-04-03
612

713
### Fixed

src/StaticAnalysis/CachingFileAnalyser.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
use const DIRECTORY_SEPARATOR;
1313
use function file_get_contents;
1414
use function file_put_contents;
15+
use function hash;
1516
use function implode;
1617
use function is_file;
17-
use function md5;
1818
use function serialize;
1919
use function unserialize;
2020
use SebastianBergmann\CodeCoverage\Util\Filesystem;
@@ -211,7 +211,8 @@ private function write(string $filename, array $data): void
211211

212212
private function cacheFile(string $filename): string
213213
{
214-
$cacheKey = md5(
214+
$cacheKey = hash(
215+
'sha256',
215216
implode(
216217
"\0",
217218
[

0 commit comments

Comments
 (0)