diff --git a/generated/8.5/functionsList.php b/generated/8.5/functionsList.php index 5b38e8b5..d011a1d4 100644 --- a/generated/8.5/functionsList.php +++ b/generated/8.5/functionsList.php @@ -268,6 +268,7 @@ 'gztell', 'gzuncompress', 'gzwrite', + 'hash_file', 'hash_update_file', 'header_register_callback', 'hex2bin', diff --git a/generated/8.5/hash.php b/generated/8.5/hash.php index 255b05ea..abf90721 100644 --- a/generated/8.5/hash.php +++ b/generated/8.5/hash.php @@ -4,6 +4,34 @@ use Safe\Exceptions\HashException; +/** + * + * + * @param string $algo Name of selected hashing algorithm (e.g. "sha256"). + * For a list of supported algorithms see hash_algos. + * @param string $filename URL describing location of file to be hashed; Supports fopen wrappers. + * @param bool $binary When set to TRUE, outputs raw binary data. + * FALSE outputs lowercase hexits. + * @param array $options An array of options for the various hashing algorithms. + * Currently, only the "seed" parameter is + * supported by the MurmurHash variants. + * @return non-falsy-string Returns a string containing the calculated message digest as lowercase hexits + * unless binary is set to true in which case the raw + * binary representation of the message digest is returned. + * @throws HashException + * + */ +function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string +{ + error_clear_last(); + $safeResult = \hash_file($algo, $filename, $binary, $options); + if ($safeResult === false) { + throw HashException::createFromPhpError(); + } + return $safeResult; +} + + /** * * diff --git a/generated/8.5/rector-migrate.php b/generated/8.5/rector-migrate.php index bf706d06..302eb8dc 100644 --- a/generated/8.5/rector-migrate.php +++ b/generated/8.5/rector-migrate.php @@ -276,6 +276,7 @@ 'gztell' => 'Safe\gztell', 'gzuncompress' => 'Safe\gzuncompress', 'gzwrite' => 'Safe\gzwrite', + 'hash_file' => 'Safe\hash_file', 'hash_update_file' => 'Safe\hash_update_file', 'header_register_callback' => 'Safe\header_register_callback', 'hex2bin' => 'Safe\hex2bin',