<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.mhash.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'mhash.examples.php',
    1 => 'Beispiele',
    2 => 'Beispiele',
  ),
  'up' => 
  array (
    0 => 'book.mhash.php',
    1 => 'Mhash',
  ),
  'prev' => 
  array (
    0 => 'mhash.constants.php',
    1 => 'Vordefinierte Konstanten',
  ),
  'next' => 
  array (
    0 => 'ref.mhash.php',
    1 => 'Mhash Funktionen',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mhash/examples.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mhash.examples" class="appendix">
 <h1 class="title">Beispiele</h1>

 <p class="para">
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 Computes the MD5 digest and hmac and print it out as hex</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$input </span><span style="color: #007700">= </span><span style="color: #DD0000">"what do ya want for nothing?"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$hash </span><span style="color: #007700">= </span><span style="color: #0000BB">mhash</span><span style="color: #007700">(</span><span style="color: #0000BB">MHASH_MD5</span><span style="color: #007700">, </span><span style="color: #0000BB">$input</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The hash is " </span><span style="color: #007700">. </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$hash</span><span style="color: #007700">) . </span><span style="color: #DD0000">"&lt;br /&gt;\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$hash </span><span style="color: #007700">= </span><span style="color: #0000BB">mhash</span><span style="color: #007700">(</span><span style="color: #0000BB">MHASH_MD5</span><span style="color: #007700">, </span><span style="color: #0000BB">$input</span><span style="color: #007700">, </span><span style="color: #DD0000">"Jefe"</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The hmac is " </span><span style="color: #007700">. </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$hash</span><span style="color: #007700">) . </span><span style="color: #DD0000">"&lt;br /&gt;\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
The hash is d03cb659cbf9192dcd066272249f8412 
The hmac is 750c783e6ab0b503eaa86e310a5db738 
</pre></div>
   </div>
  </div>
 </p>
</div>
<?php manual_footer($setup); ?>