<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.mhash.php',
    1 => 'mhash',
    2 => 'ハッシュ値を計算する',
  ),
  'up' => 
  array (
    0 => 'ref.mhash.php',
    1 => 'Mhash 関数',
  ),
  'prev' => 
  array (
    0 => 'ref.mhash.php',
    1 => 'Mhash 関数',
  ),
  'next' => 
  array (
    0 => 'function.mhash-count.php',
    1 => 'mhash_count',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    '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">ハッシュ値を計算する</span></p>

 </div>

 <div id="function.mhash-refsynopsisdiv">
  <div class="warning"><strong class="warning">警告</strong><p class="simpara">この関数は PHP 8.1.0 で
<em>非推奨</em>になります。この関数に頼らないことを強く推奨します。</p></div>
 </div>
 
 <div class="refsect1 description" id="refsect1-function.mhash-description">
  <h3 class="title">説明</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">$hash</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"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>mhash()</strong></span> は、
   <code class="parameter">hash</code> で指定したハッシュ関数を
   <code class="parameter">data</code> に適用します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mhash-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">algo</code></dt>
     <dd>
      <p class="para">
       ハッシュ ID。<strong><code>MHASH_ハッシュ名</code></strong>
       定数のいずれかを指定します。
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       ユーザーが入力した文字列。
      </p>
     </dd>
    
    
     <dt><code class="parameter">key</code></dt>
     <dd>
      <p class="para">
       指定した場合は、この関数は結果の HMAC を返します。
       HMAC は、メッセージ認証時のキーに基づくハッシュ、
       あるいは指定したキーに基づく単なるメッセージダイジェストです。
       mhash でサポートしている全てのアルゴリズムが HMAC
       モードで使用できるわけではありません。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mhash-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   結果のハッシュ (あるいはダイジェストとも言います)
   あるいは HMAC を表す文字列を返します。
   エラー時は <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mhash-changelog">
  <h3 class="title">変更履歴</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>バージョン</th>
       <th>説明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.1.0</td>
       <td>
        この関数は、推奨されなくなりました。
        <a href="ref.hash.php" class="link"><code class="literal">hash_*()</code> 関数</a> を代わりに使って下さい。
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">key</code> は、nullable になりました。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


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