php-doc-en/reference/hash/functions/hash-init.xml
Daniel Egeberg 2b587ab01f Normalized initializer NULL-values to use the &null; entity:
for file in `find -name '*.xml'`; do sed -i -e 's/<initializer>null<\/initializer>/<initializer>\&null;<\/initializer>/i' $file; done



git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@298918 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-03 17:10:04 +00:00

122 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- Generated by xml_proto.php v2.3. Found in /scripts directory of phpdoc. -->
<refentry xml:id="function.hash-init" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>hash_init</refname>
<refpurpose>Initialize an incremental hashing context</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>hash_init</methodname>
<methodparam><type>string</type><parameter>algo</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>key</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>algo</parameter></term>
<listitem>
<para>
Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Optional settings for hash generation, currently supports only one option:
<constant>HASH_HMAC</constant>. When specified, the <parameter>key</parameter>
<emphasis>must</emphasis> be specified.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
When <constant>HASH_HMAC</constant> is specified for <parameter>options</parameter>,
a shared secret key to be used with the HMAC hashing method must be supplied in this
parameter.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a Hashing Context resource for use with <function>hash_update</function>,
<function>hash_update_stream</function>, <function>hash_update_file</function>,
and <function>hash_final</function>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Incremental hashing example</title>
<programlisting role="php">
<![CDATA[
<?php
$ctx = hash_init('md5');
hash_update($ctx, 'The quick brown fox ');
hash_update($ctx, 'jumped over the lazy dog.');
echo hash_final($ctx);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
5c6ffbdd40d9556b73a21e63c3e0e904
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>hash</function></member>
<member><function>hash_file</function></member>
<member><function>hash_hmac</function></member>
<member><function>hash_hmac_file</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->