Skip to content

Commit a4c42ff

Browse files
committed
md5 replaced with xxHash
1 parent 83d9a41 commit a4c42ff

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/DI/ContainerLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function load(callable $generator, mixed $key = null): string
4040

4141
public function getClassName(mixed $key): string
4242
{
43-
return 'Container_' . substr(md5(serialize($key)), 0, 10);
43+
return 'Container_' . substr(hash('xxh128', serialize($key)), 0, 10);
4444
}
4545

4646

src/DI/DependencyChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class_uses($name),
166166
];
167167
}
168168

169-
return md5(serialize($hash));
169+
return hash('xxh128', serialize($hash));
170170
}
171171

172172

tests/DI/Compiler.dependencies.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Assert::same(
2222
[],
2323
[],
2424
[],
25-
'40cd750bba9870f18aada2478b24840a',
25+
'91a436edb651f369cac5551729145e16',
2626
],
2727
$compiler->exportDependencies(),
2828
);
@@ -37,7 +37,7 @@ Assert::same(
3737
[],
3838
[],
3939
[],
40-
'40cd750bba9870f18aada2478b24840a',
40+
'91a436edb651f369cac5551729145e16',
4141
],
4242
$compiler->exportDependencies(),
4343
);
@@ -52,7 +52,7 @@ Assert::same(
5252
[],
5353
[],
5454
[],
55-
'40cd750bba9870f18aada2478b24840a',
55+
'91a436edb651f369cac5551729145e16',
5656
],
5757
$compiler->exportDependencies(),
5858
);
@@ -87,7 +87,7 @@ Assert::same(
8787
[__FILE__ => filemtime(__FILE__)],
8888
['Dep1'],
8989
[],
90-
'1cde52df4926c96b79eaea6570f591d6',
90+
'54d3c04c0d3d52db5d38d1f0f63b9f5d',
9191
],
9292
$compiler->exportDependencies(),
9393
);

0 commit comments

Comments
 (0)