mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@331051 c90b9560-bf6c-de11-be94-00142212c4b1
121 lines
3.7 KiB
XML
121 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3e6a2269a85362c2a06c3623b9e19dd28c6dafe9 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<!-- 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>Inicializa un contexto incremental para cifrar</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>
|
|
Nombre del algoritmo de cifrado seleccionado (es decir "md5", "sha256", "haval160,4", etc..). Para una lista de los algoritmos admitidos vése <function>hash_algos</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Configuración opcional para la generación del cifrado, normalmente soporta solo una opción:
|
|
<constant>HASH_HMAC</constant>, en el caso de utilizar esta opción también <emphasis>deberemos</emphasis> especificar el parámetro <parameter>key</parameter>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>key</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Cuando se especifique <constant>HASH_HMAC</constant> en <parameter>options</parameter>, se debe suministrar una clave secreta compartida en este parámetro para ser utilizada en el método de cifrado HMAC.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve un recurso de contexto para cifrado, el cual será incrementado con <function>hash_update</function>, <function>hash_update_stream</function>, <function>hash_update_file</function>, y <function>hash_final</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de contexto incremental para cifrado</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_algos</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
|
|
-->
|