mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-25 01:28:02 +02:00
b62d2b7602
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@164657 c90b9560-bf6c-de11-be94-00142212c4b1
77 lines
2.2 KiB
XML
Executable File
77 lines
2.2 KiB
XML
Executable File
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.8 $ -->
|
|
<!-- EN-Revision: 1.7 Maintainer: didou Status: ready -->
|
|
<refentry id="function.sha1">
|
|
<refnamediv>
|
|
<refname>sha1</refname>
|
|
<refpurpose>Calcule le sha1 d'une chaîne de caractères</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>sha1</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice='opt'><type>bool</type><parameter>raw_output</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<function>sha1</function> calcule le sha1 de la chaîne de caractères
|
|
<parameter>str</parameter> en utilisant
|
|
<ulink url="&url.rfc;3174"><literal>US Secure Hash Algorithm 1</literal></ulink>,
|
|
puis retourne cette valeur. Un sha1 est un nombre hexadécimal de 40
|
|
caractères. Si le paramètre optionnel <parameter>raw_output</parameter>
|
|
est passé à &true;, le sha1 est retourné sous forme binaire brute avec
|
|
une taille de 20.
|
|
</simpara>
|
|
<note>
|
|
<simpara>
|
|
Le paramètre optionnel <parameter>raw_output</parameter> a été ajouté en
|
|
&php; 5.0.0 et vaut &false; par défaut.
|
|
</simpara>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>sha1</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = 'pomme';
|
|
|
|
if (sha1($str) === '752c14ea195c460bac3c3b7896975ee9fd15eeb7') {
|
|
echo "Voulez-vous une golden ou une spartan?";
|
|
exit;
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<simpara>
|
|
Voir aussi
|
|
<function>sha1_file</function>,
|
|
<function>crc32</function> et
|
|
<function>md5</function>
|
|
</simpara>
|
|
</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:"../../../../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
|
|
-->
|