File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,8 @@ public function fileExists(string $path): bool
494
494
*/
495
495
public function checksum (string $ path , Config $ config ): string
496
496
{
497
- $ algo = $ config ->get ('checksum_algo ' , 'sha256 ' );
497
+ // for compatibility reasons, the default checksum algorithm is md5
498
+ $ algo = $ config ->get ('checksum_algo ' , 'md5 ' );
498
499
499
500
if ($ algo !== 'sha256 ' ) {
500
501
return $ this ->calculateChecksumFromStream ($ path , $ config );
Original file line number Diff line number Diff line change @@ -226,12 +226,12 @@ public function get_checksum(): void
226
226
227
227
$ this ->assertSame (
228
228
'3858f62230ac3c915f300c664312c63f ' ,
229
- $ adapter ->checksum ('path.txt ' , new Config ([ ' checksum_algo ' => ' md5 ' ] ))
229
+ $ adapter ->checksum ('path.txt ' , new Config ())
230
230
);
231
231
232
232
$ this ->assertSame (
233
233
'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 ' ,
234
- $ adapter ->checksum ('path.txt ' , new Config ())
234
+ $ adapter ->checksum ('path.txt ' , new Config ([ ' checksum_algo ' => ' sha256 ' ] ))
235
235
);
236
236
}
237
237
Original file line number Diff line number Diff line change @@ -112,12 +112,12 @@ public function get_checksum(): void
112
112
113
113
$ this ->assertSame (
114
114
'3858f62230ac3c915f300c664312c63f ' ,
115
- $ adapter ->checksum ('path.txt ' , new Config ([ ' checksum_algo ' => ' md5 ' ] ))
115
+ $ adapter ->checksum ('path.txt ' , new Config ())
116
116
);
117
117
118
118
$ this ->assertSame (
119
119
'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 ' ,
120
- $ adapter ->checksum ('path.txt ' , new Config ())
120
+ $ adapter ->checksum ('path.txt ' , new Config ([ ' checksum_algo ' => ' sha256 ' ] ))
121
121
);
122
122
}
123
123
You can’t perform that action at this time.
0 commit comments