(PHP 5 >= 5.1.2, PHP 7, PECL hash >= 1.1)
hash_update_stream — 锟接打开碉拷锟斤拷锟斤拷锟皆撅拷墓锟较o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
$context
, resource $handle
[, int $length
= -1
] ) : int
context
锟斤拷 hash_init() 锟斤拷锟斤拷锟斤拷锟截的癸拷希锟斤拷锟斤拷锟斤拷锟斤拷锟侥★拷
handle
锟斤拷锟斤拷锟斤拷锟侥猴拷锟斤拷锟斤拷锟截的打开碉拷锟侥硷拷锟斤拷锟斤拷锟�
length
要锟斤拷 handle
锟斤拷锟皆撅拷墓锟较o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锌锟斤拷锟�
锟斤拷锟斤拷锟斤拷址锟斤拷锟斤拷锟�
锟斤拷 handle
锟斤拷锟较o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟绞碉拷锟斤拷锟斤拷锟斤拷纸锟斤拷锟斤拷锟斤拷锟�
锟芥本 | 说锟斤拷 |
---|---|
7.2.0 | 锟斤拷锟秸诧拷锟斤拷锟斤拷锟斤拷源锟斤拷锟斤拷锟睫革拷为 HashContext 锟斤拷锟斤拷锟斤拷锟酵★拷 |
Example #1 hash_update_stream() 锟斤拷锟斤拷
<?php
$fp = tmpfile();
fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
rewind($fp);
$ctx = hash_init('md5');
hash_update_stream($ctx, $fp);
echo hash_final($ctx);
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
5c6ffbdd40d9556b73a21e63c3e0e904