WS, preparing for new doc style

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227746 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-01-21 14:14:09 +00:00
parent f60c4f24e5
commit a6508f8846
5 changed files with 144 additions and 149 deletions

View file

@ -1,42 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 -->
<refentry id="function.mhash-count">
<refnamediv>
<refname>mhash_count</refname>
<refpurpose>Get the highest available hash id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mhash_count</methodname>
<void/>
</methodsynopsis>
<para>
<function>mhash_count</function> returns the highest available hash
id. Hashes are numbered from 0 to this hash id.
</para>
<para>
<example>
<title>Traversing all hashes</title>
<programlisting role="php">
<!-- $Revision: 1.4 $ -->
<refentry id="function.mhash-count">
<refnamediv>
<refname>mhash_count</refname>
<refpurpose>Get the highest available hash id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mhash_count</methodname>
<void/>
</methodsynopsis>
<para>
<function>mhash_count</function> returns the highest available hash
id. Hashes are numbered from 0 to this hash id.
</para>
<para>
<example>
<title>Traversing all hashes</title>
<programlisting role="php">
<![CDATA[
<?php
$nr = mhash_count();
for ($i = 0; $i <= $nr; $i++) {
echo sprintf("The blocksize of %s is %d\n",
echo sprintf("The blocksize of %s is %d\n",
mhash_get_hash_name($i),
mhash_get_block_size($i));
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,28 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 -->
<refentry id="function.mhash-get-block-size">
<refnamediv>
<refname>mhash_get_block_size</refname>
<refpurpose>Get the block size of the specified hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mhash_get_block_size</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_get_block_size</function> is used to get the size
of a block of the specified <parameter>hash</parameter>.
</para>
<para>
<function>mhash_get_block_size</function> takes one argument, the
<parameter>hash</parameter> and returns the size in bytes or
&false;, if the <parameter>hash</parameter> does not exist.
</para>
</refsect1>
</refentry>
<!-- $Revision: 1.3 $ -->
<refentry id="function.mhash-get-block-size">
<refnamediv>
<refname>mhash_get_block_size</refname>
<refpurpose>Get the block size of the specified hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>mhash_get_block_size</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_get_block_size</function> is used to get the size
of a block of the specified <parameter>hash</parameter>.
</para>
<para>
<function>mhash_get_block_size</function> takes one argument, the
<parameter>hash</parameter> and returns the size in bytes or
&false;, if the <parameter>hash</parameter> does not exist.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,30 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 -->
<refentry id="function.mhash-get-hash-name">
<refnamediv>
<refname>mhash_get_hash_name</refname>
<refpurpose>Get the name of the specified hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash_get_hash_name</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_get_hash_name</function> is used to get the name
of the specified hash.
</para>
<para>
<function>mhash_get_hash_name</function> takes the hash id as an
argument and returns the name of the hash or &false;, if the hash
does not exist.
</para>
<para>
<example>
<title><function>mhash_get_hash_name</function> example</title>
<programlisting role="php">
<!-- $Revision: 1.6 $ -->
<refentry id="function.mhash-get-hash-name">
<refnamediv>
<refname>mhash_get_hash_name</refname>
<refpurpose>Get the name of the specified hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash_get_hash_name</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_get_hash_name</function> is used to get the name
of the specified hash.
</para>
<para>
<function>mhash_get_hash_name</function> takes the hash id as an
argument and returns the name of the hash or &false;, if the hash
does not exist.
</para>
<para>
<example>
<title><function>mhash_get_hash_name</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$hash = MHASH_MD5;
@ -32,17 +31,17 @@ $hash = MHASH_MD5;
echo mhash_get_hash_name($hash);
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
MD5
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,42 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.7 -->
<refentry id="function.mhash-keygen-s2k">
<refnamediv>
<refname>mhash_keygen_s2k</refname>
<refpurpose>Generates a key</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash_keygen_s2k</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
<methodparam><type>string</type><parameter>salt</parameter></methodparam>
<methodparam><type>int</type><parameter>bytes</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_keygen_s2k</function> generates a key that is
<parameter>bytes</parameter> long, from a user given password.
This is the Salted S2K algorithm as specified in the OpenPGP
document (RFC 2440). That algorithm will use the specified
<parameter>hash</parameter> algorithm to create the key.
The <parameter>salt</parameter> must be different and random
enough for every key you generate in order to create different keys.
That salt must be known when you check the keys, thus it is
a good idea to append the key to it. Salt has a fixed length
of 8 bytes and will be padded with zeros if you supply less bytes.
</para>
<para>
Keep in mind that user supplied passwords are not really suitable
to be used as keys in cryptographic algorithms, since users normally
choose keys they can write on keyboard. These passwords use
only 6 to 7 bits per character (or less). It is highly recommended
to use some kind of transformation (like this function) to the user
supplied key.
</para>
</refsect1>
</refentry>
<!-- $Revision: 1.4 $ -->
<refentry id="function.mhash-keygen-s2k">
<refnamediv>
<refname>mhash_keygen_s2k</refname>
<refpurpose>Generates a key</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash_keygen_s2k</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
<methodparam><type>string</type><parameter>salt</parameter></methodparam>
<methodparam><type>int</type><parameter>bytes</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash_keygen_s2k</function> generates a key that is
<parameter>bytes</parameter> long, from a user given password.
This is the Salted S2K algorithm as specified in the OpenPGP
document (RFC 2440). That algorithm will use the specified
<parameter>hash</parameter> algorithm to create the key.
The <parameter>salt</parameter> must be different and random
enough for every key you generate in order to create different keys.
That salt must be known when you check the keys, thus it is
a good idea to append the key to it. Salt has a fixed length
of 8 bytes and will be padded with zeros if you supply less bytes.
</para>
<para>
Keep in mind that user supplied passwords are not really suitable
to be used as keys in cryptographic algorithms, since users normally
choose keys they can write on keyboard. These passwords use
only 6 to 7 bits per character (or less). It is highly recommended
to use some kind of transformation (like this function) to the user
supplied key.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,30 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/mhash.xml, last change in rev 1.2 -->
<refentry id="function.mhash">
<refnamediv>
<refname>mhash</refname>
<refpurpose>Compute hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash</function> applies a hash function specified by
<parameter>hash</parameter> to the <parameter>data</parameter> and
returns the resulting hash (also called digest). If the <parameter> key</parameter>
is specified it will return the resulting HMAC. HMAC is keyed hashing
for message authentication, or simply a message digest that depends on
the specified key. Not all algorithms supported in mhash can be used in
HMAC mode. In case of an error returns &false;.
</para>
</refsect1>
</refentry>
<!-- $Revision: 1.3 $ -->
<refentry id="function.mhash">
<refnamediv>
<refname>mhash</refname>
<refpurpose>Compute hash</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mhash</methodname>
<methodparam><type>int</type><parameter>hash</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
<function>mhash</function> applies a hash function specified by
<parameter>hash</parameter> to the <parameter>data</parameter> and
returns the resulting hash (also called digest). If the <parameter> key</parameter>
is specified it will return the resulting HMAC. HMAC is keyed hashing
for message authentication, or simply a message digest that depends on
the specified key. Not all algorithms supported in mhash can be used in
HMAC mode. In case of an error returns &false;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: