public static String getMacStr(VerifyRequest verifyRequest, String macKey){
StringBuilder allInputAreaParams = new StringBuilder();
allInputAreaParams.append(verifyRequest.getVersionId());
allInputAreaParams.append(verifyRequest.getChrSet());
String allInputAreaParamsStr = allInputAreaParams.toString();
String md5SourceText = allInputAreaParamsStr + macKey;
System.out.println(DigestUtils.md5Hex(md5SourceText));
return DigestUtils.md5Hex(md5SourceText);
}
3 回答
紫衣仙女
TA贡献1839条经验 获得超15个赞
class VerifyRequest{
private $versionId;
private $chrSet;
public function getVersionId(){
return $this->$versionId;
}
public function getChrSet(){
return $this->$chrSet;
}
}
static function getMacStr($verifyRequest,$macKey){
$allInputAreaParams = $verifyRequest->getVersionId().$verifyRequest->getMacStr();
$md5SourceText = $allInputAreaParams.$macKey;
return md5($md5SourceText);
}
就是一个hash的算法而已
添加回答
举报
0/150
提交
取消