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>
...
...
@@ -24,7 +24,7 @@
24
24
<term><parameter>algo</parameter></term>
25
25
<listitem>
26
26
<para>
27
-
Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..) See <function>hash_algos</function> for a list of supported algorithms.
27
+
Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..) See <function>hash_hmac_algos</function> for a list of supported algorithms.
28
28
</para>
29
29
</listitem>
30
30
</varlistentry>
...
...
@@ -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,9 +61,47 @@
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.
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.
75
+
</para>
76
+
</refsect1>
77
+

78
+
<refsect1 role="changelog">
79
+
&reftitle.changelog;
80
+
<para>
81
+
<informaltable>
82
+
<tgroup cols="2">
83
+
<thead>
84
+
<row>
85
+
<entry>&Version;</entry>
86
+
<entry>&Description;</entry>
87
+
</row>
88
+
</thead>
89
+
<tbody>
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>
99
+
<entry>7.2.0</entry>
100
+
<entry>Usage of non-cryptographic hash functions (adler32, crc32, crc32b, fnv132, fnv1a32, fnv164, fnv1a64, joaat) was disabled.</entry>
101
+
</row>
102
+
</tbody>
103
+
</tgroup>
104
+
</informaltable>
67
105
</para>
68
106
</refsect1>
69
107

...
...
@@ -75,14 +113,14 @@
75
113
<programlisting role="php">
76
114
<![CDATA[
77
115
<?php
78
-
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');
79
117
?>
80
118
]]>
81
119
</programlisting>
82
120
&example.outputs;
83
121
<screen>
84
122
<![CDATA[
85
-
b8e7ae12510bdfb1812e463a7f086122cf37e4f7
123
+
9c5c42422b03f0ee32949920649445e417b2c634050833c5165704b825c2a53b
86
124
]]>
87
125
</screen>
88
126
</example>
...
...
@@ -94,15 +132,15 @@ b8e7ae12510bdfb1812e463a7f086122cf37e4f7
94
132
<para>
95
133
<simplelist>
96
134
<member><function>hash</function></member>
97
-
<member><function>hash_algos</function></member>
135
+
<member><function>hash_hmac_algos</function></member>
98
136
<member><function>hash_init</function></member>
99
137
<member><function>hash_hmac_file</function></member>
138
+
<member><function>hash_equals</function></member>
100
139
</simplelist>
101
140
</para>
102
141
</refsect1>
103
142

104
143
</refentry>
105
-

106
144
<!-- Keep this comment at the end of the file
107
145
Local variables:
108
146
mode: sgml
109
147