Skip to content

Commit 248e815

Browse files
Merge pull request #653 from RobertBoes/replace-md5-with-xxhash
[2.x] Replace md5 with xxhash
2 parents 23a6f3b + 61b1c89 commit 248e815

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Middleware.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class Middleware
2929
public function version(Request $request)
3030
{
3131
if (config('app.asset_url')) {
32-
return md5(config('app.asset_url'));
32+
return hash('xxh128', config('app.asset_url'));
3333
}
3434

3535
if (file_exists($manifest = public_path('mix-manifest.json'))) {
36-
return md5_file($manifest);
36+
return hash_file('xxh128', $manifest);
3737
}
3838

3939
if (file_exists($manifest = public_path('build/manifest.json'))) {
40-
return md5_file($manifest);
40+
return hash_file('xxh128', $manifest);
4141
}
4242

4343
return null;

tests/ResponseFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ public function test_the_version_can_be_a_closure(): void
112112
$this->assertSame('', Inertia::getVersion());
113113

114114
Inertia::version(function () {
115-
return md5('Inertia');
115+
return hash('xxh128', 'Inertia');
116116
});
117117

118118
return Inertia::render('User/Edit');
119119
});
120120

121121
$response = $this->withoutExceptionHandling()->get('/', [
122122
'X-Inertia' => 'true',
123-
'X-Inertia-Version' => 'b19a24ee5c287f42ee1d465dab77ab37',
123+
'X-Inertia-Version' => 'f445bd0a2c393a5af14fc677f59980a9',
124124
]);
125125

126126
$response->assertSuccessful();

0 commit comments

Comments
 (0)