Skip to content

Commit 0f62203

Browse files
asgrimTimWolla
andauthored
BinaryFile should use hash_file instead of hash+fgc
Co-authored-by: Tim Düsterhus <[email protected]>
1 parent 77b31e5 commit 0f62203

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/BinaryFile.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
namespace Php\Pie;
66

7-
use function file_get_contents;
8-
use function hash;
7+
use function hash_file;
98

109
/**
1110
* @internal This is not public API for PIE, so should not be depended upon unless you accept the risk of BC breaks
@@ -31,7 +30,7 @@ public static function fromFileWithSha256Checksum(string $filePath): self
3130
{
3231
return new self(
3332
$filePath,
34-
hash(self::HASH_TYPE_SHA256, file_get_contents($filePath)),
33+
hash_file(self::HASH_TYPE_SHA256, $filePath),
3534
);
3635
}
3736
}

0 commit comments

Comments
 (0)