编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 预定义常量
  • Mhash 函数 »
  • PHP Manual
  • Mhash
  • 范例

范例

Example #1 Computes the MD5 digest and hmac and print it out as hex

<?php
$input 
= "what do ya want for nothing?";
$hash = mhash(MHASH_MD5, $input);
echo 
"The hash is " . bin2hex($hash) . "<br />\n";
$hash = mhash(MHASH_MD5, $input, "Jefe");
echo 
"The hmac is " . bin2hex($hash) . "<br />\n";
?>

以上例程会输出:

The hash is d03cb659cbf9192dcd066272249f8412 
The hmac is 750c783e6ab0b503eaa86e310a5db738 

相关文章
php 加密扩展 mhashphp ibm db2 函数 used to escape certain charactersphp ibm db2 函数 frees resources associated with a result setphp ibm db2 函数 returns an object with properties that describe the db2 database serverphp mhash 函数 gets the highest available hash idphp mhash 函数 gets the block size of the specified hashphp mhash 函数 gets the name of the specified hashphp mhash 函数 generates a keyphp mhash 函数 computes hashphp wincache 函数 retrieves information about memory usage by the resolve file path cachephp xattr 函数 get an extended attributephp xdiff 函数 patch a string with a binary diffphp mhash 简介php mhash 预定义常量php mhash 范例php mhash 安装/配置php 范例 basic usagephp phar compresses all files in the current phar archive using gzip compressionphp phar extract the contents of a phar archive to a directoryphp mhash mhash 函数
关注编程学问公众号
编程学问网 湘ICP备20001732号