123333
This commit is contained in:
@@ -4,9 +4,20 @@ import java.security.MessageDigest;
|
||||
|
||||
public class CheckSumBuilder {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String appSecret = "77c09917d2de";
|
||||
String curTime = "1707115388876";
|
||||
String body = "{\"clientType\":\"IOS\",\"code\":\"200\",\"clientIp\":\"117.153.13.133\",\"accid\":\"33503\",\"sdkVersion\":\"91301\",\"eventType\":\"2\",\"deviceId\":\"2957635E-A852-4EBD-94C7-AA1FFA71551B\",\"timestamp\":\"1707115388795\"}";
|
||||
String verifyMD5 = CheckSumBuilder.getMD5(body);
|
||||
System.out.println(verifyMD5);
|
||||
String verifyChecksum = CheckSumBuilder.getCheckSum(appSecret, verifyMD5, curTime);
|
||||
System.out.println(verifyChecksum);
|
||||
}
|
||||
|
||||
|
||||
// 计算并获取CheckSum
|
||||
public static String getCheckSum(String appSecret, String nonce, String curTime) {
|
||||
return encode("sha1", appSecret + nonce + curTime);
|
||||
public static String getCheckSum(String appSecret, String bodyMd5, String curTime) {
|
||||
return encode("sha1", appSecret + bodyMd5 + curTime);
|
||||
}
|
||||
|
||||
// 计算并获取md5值
|
||||
|
||||
Reference in New Issue
Block a user