reference/hash/functions/hash-hmac.xml
33b00cc27920489594afa964ffbf2660e4e245f7
...
...
@@ -12,7 +12,7 @@
12
12
<methodparam><type>string</type><parameter>algo</parameter></methodparam>
13
13
<methodparam><type>string</type><parameter>data</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,10 +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.
66
+
</para>
67
+
</refsect1>
68
+

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

...
...
@@ -81,6 +88,14 @@
81
88
</thead>
82
89
<tbody>
83
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
95
+
non-cryptographic hash function; previously, &false; was returned instead.
96
+
</entry>
97
+
</row>
98
+
<row>
84
99
<entry>7.2.0</entry>
85
100
<entry>Usage of non-cryptographic hash functions (adler32, crc32, crc32b, fnv132, fnv1a32, fnv164, fnv1a64, joaat) was disabled.</entry>
86
101
</row>
...
...
@@ -98,14 +113,14 @@
98
113
<programlisting role="php">
99
114
<![CDATA[
100
115
<?php
101
-
echo hash_hmac('ripemd160', 'The quick brown fox jumped over the lazy dog.', 'secret');
116
+
echo hash_hmac('sha256', 'The quick brown fox jumped over the lazy dog.', 'secret');
102
117
?>
103
118
]]>
104
119
</programlisting>
105
120
&example.outputs;
106
121
<screen>
107
122
<![CDATA[
108
-
b8e7ae12510bdfb1812e463a7f086122cf37e4f7
123
+
9c5c42422b03f0ee32949920649445e417b2c634050833c5165704b825c2a53b
109
124
]]>
110
125
</screen>
111
126
</example>
...
...
@@ -120,12 +135,12 @@ b8e7ae12510bdfb1812e463a7f086122cf37e4f7
120
135
<member><function>hash_hmac_algos</function></member>
121
136
<member><function>hash_init</function></member>
122
137
<member><function>hash_hmac_file</function></member>
138
+
<member><function>hash_equals</function></member>
123
139
</simplelist>
124
140
</para>
125
141
</refsect1>
126
142

127
143
</refentry>
128
-

129
144
<!-- Keep this comment at the end of the file
130
145
Local variables:
131
146
mode: sgml
132
147