reference/hash/functions/hash-hmac-file.xml
50960545e781ff94ba371befc04346de48a0bb82
...
...
@@ -8,11 +8,11 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>string</type><methodname>hash_hmac_file</methodname>
11
+
<type class="union"><type>string</type><type>false</type></type><methodname>hash_hmac_file</methodname>
12
12
<methodparam><type>string</type><parameter>algo</parameter></methodparam>
13
13
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>key</parameter></methodparam>
15
-
<methodparam choice="opt"><type>bool</type><parameter>raw_output</parameter><initializer>&false;</initializer></methodparam>
15
+
<methodparam choice="opt"><type>bool</type><parameter>binary</parameter><initializer>&false;</initializer></methodparam>
16
16
</methodsynopsis>
17
17

18
18
</refsect1>
...
...
@@ -45,7 +45,7 @@
45
45
</listitem>
46
46
</varlistentry>
47
47
<varlistentry>
48
-
<term><parameter>raw_output</parameter></term>
48
+
<term><parameter>binary</parameter></term>
49
49
<listitem>
50
50
<para>
51
51
When set to &true;, outputs raw binary data.
...
...
@@ -61,11 +61,17 @@
61
61
&reftitle.returnvalues;
62
62
<para>
63
63
Returns a string containing the calculated message digest as lowercase hexits
64
-
unless <parameter>raw_output</parameter> is set to true in which case the raw
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>
...
...
@@ -128,7 +142,6 @@ echo hash_hmac_file('md5', 'example.txt', 'secret');
128
142
</refsect1>
129
143

130
144
</refentry>
131
-

132
145
<!-- Keep this comment at the end of the file
133
146
Local variables:
134
147
mode: sgml
135
148