CakeFest 2024: The Official CakePHP Conference

Примеры

Пример #1 Вычисление MD5 и HMAC и печать их в шестнадцатеричном виде

<?php
$input
= "what do ya want for nothing?";
$hash = mhash(MHASH_MD5, $input);
echo
"Хеш MD5 - " . bin2hex($hash) . "<br />\n";
$hash = mhash(MHASH_MD5, $input, "Jefe");
echo
"Хеш HMAC - " . bin2hex($hash) . "<br />\n";
?>

Результат выполнения приведённого примера:

Хеш MD5 - d03cb659cbf9192dcd066272249f8412
Хеш HMAC - 750c783e6ab0b503eaa86e310a5db738

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top