Manuel PHP

Exemples

Exemple #1 Calcule le MD5 et le hmac, puis l'affiche comme un hexadécimal

  1. <?php
  2. $input = "what do ya want for nothing?";  
  3. $hash = mhash(MHASH_MD5, $input);  
  4. echo "Le hash vaut " . bin2hex($hash) . "<br />\n";  
  5. $hash = mhash(MHASH_MD5, $input, "Jefe");  
  6. echo "Le hmac vaut " . bin2hex($hash) . "<br />\n";  
  7. ?> 

This will produce:

Le hash vaut d03cb659cbf9192dcd066272249f8412 Le hmac vaut 750c783e6ab0b503eaa86e310a5db738


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique