hash_update_stream

(PHP 5 >= 5.1.2, PHP 7, PECL hash >= 1.1)

hash_update_stream锟接打开碉拷锟斤拷锟斤拷锟皆撅拷墓锟较o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷

说锟斤拷

hash_update_stream ( HashContext $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

锟轿硷拷

  • hash_init() - 锟斤拷始锟斤拷锟斤拷锟斤拷锟斤拷希锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
  • hash_update() - 锟斤拷锟皆撅拷墓锟较o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
  • hash_final() - 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷希锟斤拷锟斤拷锟揭凤拷锟斤拷摘要锟斤拷锟�
  • hash() - 锟斤拷锟缴癸拷希值 锟斤拷锟斤拷息摘要锟斤拷
  • hash_file() - 使锟矫革拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟斤拷锟缴癸拷希值