reference/hash/functions/hash-update-stream.xml
20dcfbb0dd7150cbe5dfd7903a3001229295c549
...
...
@@ -9,8 +9,8 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>int</type><methodname>hash_update_stream</methodname>
12
-
<methodparam><type>resource</type><parameter>context</parameter></methodparam>
13
-
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
12
+
<methodparam><type>HashContext</type><parameter>context</parameter></methodparam>
13
+
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>-1</initializer></methodparam>
15
15
</methodsynopsis>
16
16

...
...
@@ -28,7 +28,7 @@
28
28
</listitem>
29
29
</varlistentry>
30
30
<varlistentry>
31
-
<term><parameter>handle</parameter></term>
31
+
<term><parameter>stream</parameter></term>
32
32
<listitem>
33
33
<para>
34
34
Open file handle as returned by any stream creation function.
...
...
@@ -39,7 +39,7 @@
39
39
<term><parameter>length</parameter></term>
40
40
<listitem>
41
41
<para>
42
-
Maximum number of characters to copy from <parameter>handle</parameter>
42
+
Maximum number of characters to copy from <parameter>stream</parameter>
43
43
into the hashing context.
44
44
</para>
45
45
</listitem>
...
...
@@ -51,7 +51,31 @@
51
51
<refsect1 role="returnvalues">
52
52
&reftitle.returnvalues;
53
53
<para>
54
-
Actual number of bytes added to the hashing context from <parameter>handle</parameter>.
54
+
Actual number of bytes added to the hashing context from <parameter>stream</parameter>.
55
+
</para>
56
+
</refsect1>
57
+

58
+
<refsect1 role="changelog">
59
+
&reftitle.changelog;
60
+
<para>
61
+
<informaltable>
62
+
<tgroup cols="2">
63
+
<thead>
64
+
<row>
65
+
<entry>&Version;</entry>
66
+
<entry>&Description;</entry>
67
+
</row>
68
+
</thead>
69
+
<tbody>
70
+
<row>
71
+
<entry>7.2.0</entry>
72
+
<entry>
73
+
Accept <classname>HashContext</classname> instead of resource.
74
+
</entry>
75
+
</row>
76
+
</tbody>
77
+
</tgroup>
78
+
</informaltable>
55
79
</para>
56
80
</refsect1>
57
81
...
...
@@ -64,10 +88,11 @@
64
88
<![CDATA[
65
89
<?php
66
90
$fp = tmpfile();
67
-
fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
91
+
fwrite($fp, 'jumped over the lazy dog.');
68
92
rewind($fp);
69
93

70
-
$ctx = hash_init('md5');
94
+
$ctx = hash_init('sha256');
95
+
hash_update($ctx, 'The quick brown fox ');
71
96
hash_update_stream($ctx, $fp);
72
97
echo hash_final($ctx);
73
98
?>
...
...
@@ -76,7 +101,7 @@ echo hash_final($ctx);
76
101
&example.outputs;
77
102
<screen>
78
103
<![CDATA[
79
-
5c6ffbdd40d9556b73a21e63c3e0e904
104
+
68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483
80
105
]]>
81
106
</screen>
82
107
</example>
...
...
@@ -97,7 +122,6 @@ echo hash_final($ctx);
97
122
</refsect1>
98
123

99
124
</refentry>
100
-

101
125
<!-- Keep this comment at the end of the file
102
126
Local variables:
103
127
mode: sgml
104
128