reference/hash/functions/hash-file.xml
20dcfbb0dd7150cbe5dfd7903a3001229295c549
...
...
@@ -9,10 +9,11 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>hash_file</methodname>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>hash_file</methodname>
13
13
<methodparam><type>string</type><parameter>algo</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>filename</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
+
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
16
17
</methodsynopsis>
17
18

18
19
</refsect1>
...
...
@@ -37,7 +38,7 @@
37
38
</listitem>
38
39
</varlistentry>
39
40
<varlistentry>
40
-
<term><parameter>raw_output</parameter></term>
41
+
<term><parameter>binary</parameter></term>
41
42
<listitem>
42
43
<para>
43
44
When set to &true;, outputs raw binary data.
...
...
@@ -45,6 +46,15 @@
45
46
</para>
46
47
</listitem>
47
48
</varlistentry>
49
+
<varlistentry>
50
+
<term><parameter>options</parameter></term>
51
+
<listitem>
52
+
<para>
53
+
An array of options for the various hashing algorithms. Currently, only the "seed" parameter is
54
+
supported by the MurmurHash variants.
55
+
</para>
56
+
</listitem>
57
+
</varlistentry>
48
58
</variablelist>
49
59
</para>
50
60
</refsect1>
...
...
@@ -53,11 +63,33 @@
53
63
&reftitle.returnvalues;
54
64
<para>
55
65
Returns a string containing the calculated message digest as lowercase hexits
56
-
unless <parameter>raw_output</parameter> is set to true in which case the raw
66
+
unless <parameter>binary</parameter> is set to true in which case the raw
57
67
binary representation of the message digest is returned.
58
68
</para>
59
69
</refsect1>
60
70

71
+
<refsect1 role="changelog">
72
+
&reftitle.changelog;
73
+
<para>
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>8.1.0</entry>
85
+
<entry>The <parameter>options</parameter> parameter has been added.</entry>
86
+
</row>
87
+
</tbody>
88
+
</tgroup>
89
+
</informaltable>
90
+
</para>
91
+
</refsect1>
92
+

61
93
<refsect1 role="examples">
62
94
&reftitle.examples;
63
95
<para>
...
...
@@ -69,14 +101,14 @@
69
101
/* Create a file to calculate hash of */
70
102
file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.');
71
103

72
-
echo hash_file('md5', 'example.txt');
104
+
echo hash_file('sha256', 'example.txt');
73
105
?>
74
106
]]>
75
107
</programlisting>
76
108
&example.outputs;
77
109
<screen>
78
110
<![CDATA[
79
-
5c6ffbdd40d9556b73a21e63c3e0e904
111
+
68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483
80
112
]]>
81
113
</screen>
82
114
</example>
...
...
@@ -97,7 +129,6 @@ echo hash_file('md5', 'example.txt');
97
129
</refsect1>
98
130

99
131
</refentry>
100
-

101
132
<!-- Keep this comment at the end of the file
102
133
Local variables:
103
134
mode: sgml
104
135