You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
32
extend/alipay/Md5function.php
Executable file
32
extend/alipay/Md5function.php
Executable file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 签名字符串
|
||||
* @param $prestr 需要签名的字符串
|
||||
* @param $key 私钥
|
||||
* return 签名结果
|
||||
*/
|
||||
function md5Sign($prestr, $key) {
|
||||
$prestr = $prestr . $key;
|
||||
return md5($prestr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证签名
|
||||
* @param $prestr 需要签名的字符串
|
||||
* @param $sign 签名结果
|
||||
* @param $key 私钥
|
||||
* return 签名结果
|
||||
*/
|
||||
function md5Verify($prestr, $sign, $key) {
|
||||
$prestr = $prestr . $key;
|
||||
$mysgin = md5($prestr);
|
||||
|
||||
if($mysgin == $sign) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user