reference/hash/functions/hash-file.xml
db22a7cfcbc3af221f67e228336ac3e2d62aaf2c
...
...
@@ -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,16 @@
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.
54
+
Currently, only the <literal>"seed"</literal> parameter is
55
+
supported by the MurmurHash variants.
56
+
</para>
57
+
</listitem>
58
+
</varlistentry>
48
59
</variablelist>
49
60
</para>
50
61
</refsect1>
...
...
@@ -53,11 +64,33 @@
53
64
&reftitle.returnvalues;
54
65
<para>
55
66
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
67
+
unless <parameter>binary</parameter> is set to true in which case the raw
57
68
binary representation of the message digest is returned.
58
69
</para>
59
70
</refsect1>
60
71

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

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

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

99
132
</refentry>
100
-

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