Use the highest level form if there is no good reason.
sha1_file. sha1_file - , . "" , / 1: - .
, 5 -2 ( ) / file_get_contents, . / .
1 sha1_file github. , , :
PHP_FUNCTION(sha1_file)
{
stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
PHP_SHA1Init(&context);
while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
PHP_SHA1Update(&context, buf, n);
}
PHP_SHA1Final(digest, &context);
php_stream_close(stream);
}
, . .