<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mhash.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.mhash.php',
    1 => 'mhash',
    2 => 'Calcule un hash',
  ),
  'up' => 
  array (
    0 => 'ref.mhash.php',
    1 => 'Fonctions Mhash',
  ),
  'prev' => 
  array (
    0 => 'ref.mhash.php',
    1 => 'Fonctions Mhash',
  ),
  'next' => 
  array (
    0 => 'function.mhash-count.php',
    1 => 'mhash_count',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mhash/functions/mhash.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mhash" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mhash</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mhash</span> &mdash; <span class="dc-title">Calcule un hash</span></p>

 </div>

 <div id="function.mhash-refsynopsisdiv">
  <div class="warning"><strong class="warning">Avertissement</strong><p class="simpara">
 Cette fonction est <em>OBSOLÈTE</em> à partir de PHP 8.1.0.
 Dépendre de cette fonction est fortement déconseillé.
</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mhash-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>mhash</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$algo</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$key</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</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>mhash()</strong></span> applique la fonction de hash
   <code class="parameter">algo</code> aux données <code class="parameter">data</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mhash-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">algo</code></dt>
     <dd>
      <p class="para">
       L&#039;identifiant du hash. Une parmi les constantes
       <strong><code>MHASH_hashname</code></strong>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       L&#039;entrée utilisateur, sous la forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">key</code></dt>
     <dd>
      <p class="para">
       Spécifié, la fonction retournera le HMAC résultant. HMAC est un hachage à clé
       utilisé pour l&#039;authentification de messages, ou simplement un condensé de
       message qui dépend de la clé spécifiée. Certains algorithmes supportés dans
       mhash ne sont pas compatibles avec le mode HMAC.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mhash-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne le hash résultant (appelé aussi &quot;digest&quot;) ou HMAC, sous la
   forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a> ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mhash-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.1.0</td>
       <td>
        Cette fonction a été rendue obsolète.
        Utiliser les <a href="ref.hash.php" class="link">fonctions <code class="literal">hash_*()</code></a> à la place.
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">key</code> est désormais nullable.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


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