switch style and add note about the streams API use in PHP 5.1.0

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@186768 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2005-05-22 10:31:23 +00:00
parent 8dd919817d
commit 21934389c2
2 changed files with 190 additions and 72 deletions

View file

@ -1,44 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.md5-file">
<refnamediv>
<refname>md5_file</refname>
<refpurpose>Calculates the md5 hash of a given file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>md5_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice='opt'><type>bool</type><parameter>raw_output</parameter></methodparam>
</methodsynopsis>
<para>
Calculates the MD5 hash of the file specified by the
<parameter>filename</parameter> parameter using the
<ulink url="&url.rfc;1321">RSA Data Security, Inc.
MD5 Message-Digest Algorithm</ulink>, and returns that hash.
The hash is a 32-character hexadecimal number. If the optional
<parameter>raw_output</parameter> is set to &true;, then the md5 digest
is instead returned in raw binary format with a length of 16.
</para>
<note>
<simpara>
The optional <parameter>raw_output</parameter> parameter was added in
PHP 5.0.0 and defaults to &false;
</simpara>
</note>
<para>
This function has the same purpose of the command line utility
md5sum.
</para>
<para>
See also <function>md5</function>,
<function>crc32</function>, and
<function>sha1_file</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.md5-file">
<refnamediv>
<refname>md5_file</refname>
<refpurpose>Calculates the md5 hash of a given file</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>md5_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice='opt'><type>bool</type><parameter>raw_output</parameter></methodparam>
</methodsynopsis>
<para>
Calculates the MD5 hash of the file specified by the
<parameter>filename</parameter> parameter using the
<ulink url="&url.rfc;1321">RSA Data Security, Inc.
MD5 Message-Digest Algorithm</ulink>, and returns that hash.
The hash is a 32-character hexadecimal number.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The filename
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>raw_output</parameter></term>
<listitem>
<para>
When &true;, returns the digest in raw binary format with a length of
16. Defaults to &false;.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a string on success, &false; otherwise.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.0.0</entry>
<entry>
Added the <parameter>raw_output</parameter> parameter
</entry>
</row>
<row>
<entry>5.1.0</entry>
<entry>
Changed the function to use the streams API. It means that you can use
it with wrappers, like <literal>md5_file('http://example.com/..')</literal>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>md5</function></member>
<member><function>sha1_file</function></member>
<member><function>crc32</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,37 +1,98 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<refentry id="function.sha1-file">
<refnamediv>
<refname>sha1_file</refname>
<refpurpose>Calculate the sha1 hash of a file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>sha1_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice='opt'><type>bool</type><parameter>raw_output</parameter></methodparam>
</methodsynopsis>
<simpara>
Calculates the sha1 hash of <parameter>filename</parameter> using the
<ulink url="&url.rfc;3174">US Secure Hash Algorithm 1</ulink>,
and returns that hash. The hash is a 40-character hexadecimal number.
Upon failure, &false; is returned. If the optional
<parameter>raw_output</parameter> is set to &true;, then the sha1 digest
is instead returned in raw binary format with a length of 20.
</simpara>
<note>
<simpara>
The optional <parameter>raw_output</parameter> parameter was added in
PHP 5.0.0 and defaults to &false;
</simpara>
</note>
<simpara>
See also <function>sha1</function>, <function>crc32</function>,
and <function>md5_file</function>
</simpara>
</refsect1>
</refentry>
<!-- $Revision: 1.5 $ -->
<refentry id="function.sha1-file">
<refnamediv>
<refname>sha1_file</refname>
<refpurpose>Calculate the sha1 hash of a file</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>sha1_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice='opt'><type>bool</type><parameter>raw_output</parameter></methodparam>
</methodsynopsis>
<simpara>
Calculates the sha1 hash of <parameter>filename</parameter> using the
<ulink url="&url.rfc;3174">US Secure Hash Algorithm 1</ulink>,
and returns that hash. The hash is a 40-character hexadecimal number.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The filename
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>raw_output</parameter></term>
<listitem>
<para>
When &true;, returns the digest in raw binary format with a length of
20. Defaults to &false;.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a string on success, &false; otherwise.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.0.0</entry>
<entry>
Added the <parameter>raw_output</parameter> parameter
</entry>
</row>
<row>
<entry>5.1.0</entry>
<entry>
Changed the function to use the streams API. It means that you can use
it with wrappers, like <literal>sha1_file('http://example.com/..')</literal>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>sha1</function></member>
<member><function>md5_file</function></member>
<member><function>crc32</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: