reference/hash/functions/hash-hmac-file.xml
50960545e781ff94ba371befc04346de48a0bb82
...
...
@@ -63,9 +63,15 @@
63
63
Returns a string containing the calculated message digest as lowercase hexits
64
64
unless <parameter>binary</parameter> is set to true in which case the raw
65
65
binary representation of the message digest is returned.
66
-
Returns &false; when <parameter>algo</parameter> is unknown or is a
67
-
non-cryptographic hash function, or if the file
68
-
<parameter>filename</parameter> cannot be read.
66
+
Returns &false; if the file <parameter>filename</parameter> cannot be read.
67
+
</para>
68
+
</refsect1>
69
+

70
+
<refsect1 role="errors">
71
+
&reftitle.errors;
72
+
<para>
73
+
Throws a <classname>ValueError</classname> exception if
74
+
<parameter>algo</parameter> is unknown or is a non-cryptographic hash function.
69
75
</para>
70
76
</refsect1>
71
77

...
...
@@ -82,6 +88,14 @@
82
88
</thead>
83
89
<tbody>
84
90
<row>
91
+
<entry>8.0.0</entry>
92
+
<entry>
93
+
Now throws a <classname>ValueError</classname> exception if
94
+
<parameter>algo</parameter> is unknown or is a non-cryptographic hash
95
+
function; previously, &false; was returned instead.
96
+
</entry>
97
+
</row>
98
+
<row>
85
99
<entry>7.2.0</entry>
86
100
<entry>Usage of non-cryptographic hash functions (adler32, crc32, crc32b, fnv132, fnv1a32, fnv164, fnv1a64, joaat) was disabled.</entry>
87
101
</row>
...
...
@@ -102,14 +116,14 @@
102
116
/* Create a file to calculate hash of */
103
117
file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.');
104
118

105
-
echo hash_hmac_file('md5', 'example.txt', 'secret');
119
+
echo hash_hmac_file('sha256', 'example.txt', 'secret');
106
120
?>
107
121
]]>
108
122
</programlisting>
109
123
&example.outputs;
110
124
<screen>
111
125
<![CDATA[
112
-
7eb2b5c37443418fc77c136dd20e859c
126
+
9c5c42422b03f0ee32949920649445e417b2c634050833c5165704b825c2a53b
113
127
]]>
114
128
</screen>
115
129
</example>
116
130