略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 范例

2024-12-20

范例

示例 #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 
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mhash.examples.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3