game2006api/webapp/services/callback/common/SignatureService.php
aozhiwei 5368924a12 1
2023-07-14 13:49:08 +08:00

37 lines
841 B
PHP

<?php
namespace services;
class SignatureService {
const ERRCODE_SIGN = 2001;
public static function web3ServiceCheck()
{
$cbUuid = getReqVal('_cb_uuid', '');
$row = SqlHelper::ormSelectOne(
myself()->_getMarketMysql(),
't_callback',
array(
'cb_uuid' => $cbUuid
)
);
if (!$row) {
myself()-_rspErr(self::ERRCODE);
die();
}
}
public static function normalMd5Sign($params, $secretKey, $excludeKeys){
ksort($params);
$paramsStr = '';
foreach($params as $key => $val){
if (!in_array($key, $excludeKeys)) {
$paramsStr = $paramsStr . $key . '=' . $val . $connStr;
}
}
return md5($paramsStr . $$secretKey);
}
}