基于md5的php hmac算法
时间:2008-04-05 来源:lib
64) ? pack('H32', 'md5') : str_pad($key, 64, chr(0));
$ipad = substr($key,0, 64) ^ str_repeat(chr(0x36), 64);
$opad = substr($key,0, 64) ^ str_repeat(chr(0x5C), 64);
return md5($opad.pack('H32', md5($ipad.$data)));
}
//---------------------------------------------
//使用例子
function getKey () {
$tmp = array_merge(range(0, 9), range('A', 'Z'));
$key = '';
for ($i = 0; $i
$ipad = substr($key,0, 64) ^ str_repeat(chr(0x36), 64);
$opad = substr($key,0, 64) ^ str_repeat(chr(0x5C), 64);
return md5($opad.pack('H32', md5($ipad.$data)));
}
//---------------------------------------------
//使用例子
function getKey () {
$tmp = array_merge(range(0, 9), range('A', 'Z'));
$key = '';
for ($i = 0; $i
相关阅读 更多 +
排行榜 更多 +