<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.md5-file.php',
    1 => 'md5_file',
    2 => 'Calcule le md5 d\'un fichier',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res',
  ),
  'prev' => 
  array (
    0 => 'function.md5.php',
    1 => 'md5',
  ),
  'next' => 
  array (
    0 => 'function.metaphone.php',
    1 => 'metaphone',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/strings/functions/md5-file.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.md5-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">md5_file</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">md5_file</span> &mdash; <span class="dc-title">Calcule le md5 d&#039;un fichier</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.md5-file-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>md5_file</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$binary</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>md5_file()</strong></span> calcule le MD5 du fichier
   <code class="parameter">filename</code> en utilisant l&#039;algorithme
   <a href="https://datatracker.ietf.org/doc/html/rfc1321" class="link external">&raquo;&nbsp;<code class="literal">RSA Data Security, Inc. 
   MD5 Message-Digest Algorithm</code></a>, 
   puis retourne la
   valeur ainsi calculée. Le résultat est un nombre de 32 
   caractères hexadécimaux.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.md5-file-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Le nom du fichier
      </p>
     </dd>
    
    
     <dt><code class="parameter">binary</code></dt>
     <dd>
      <p class="para">
       Lorsque <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, retourne le prétraitement en format binaire brut avec
       une grandeur de 16.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.md5-file-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une chaîne de caractères en cas de succès, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> autrement.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.md5-file-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple d&#039;utilisation de <span class="function"><strong>md5_file()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$file </span><span style="color: #007700">= </span><span style="color: #DD0000">'/examples/book.xml'</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #DD0000">'La signature MD5 du fichier ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$file </span><span style="color: #007700">. </span><span style="color: #DD0000">' est ' </span><span style="color: #007700">. </span><span style="color: #0000BB">md5_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
   </p>
  </div>

  
 <div class="refsect1 seealso" id="refsect1-function.md5-file-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.hash-file.php" class="function" rel="rdfs-seeAlso">hash_file()</a> - G&eacute;n&egrave;re une valeur de hachage en utilisant le contenu d'un fichier donn&eacute;</span></li>
    <li><span class="function"><a href="function.hash-init.php" class="function" rel="rdfs-seeAlso">hash_init()</a> - Initialise un contexte de hachage incr&eacute;mental</span></li>
    <li><span class="function"><a href="function.md5.php" class="function" rel="rdfs-seeAlso">md5()</a> - Calcule le md5 d'une cha&icirc;ne</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>