Java有SHA1加密的API接口吗
3 回答
侃侃尔雅
TA贡献1801条经验 获得超16个赞
function encryptTokey($data){
$apikey = 'testapikey111';
$ps1 = sha1($apikey . strtolower($data));
$ps1 = strtoupper($ps1);
$s1 = implode(str_split($ps1, 2), '-');
$ps2 = md5($s1 . $apikey);
$ps2 = strtoupper($ps2);
$token = implode(str_split($ps2, 2), '-');
return $token;
}
echo encryptTokey('testdata');
运行结果:
68-10-98-74-4C-82-74-4B-CC-49-31-98-46-02-EE-8E
添加回答
举报
0/150
提交
取消