This commit is contained in:
Jesse-Ma
2022-12-09 14:15:14 +08:00
parent 862d47d76f
commit 3a2e7dc2d6
4 changed files with 40 additions and 24 deletions

View File

@@ -84,12 +84,12 @@ public class BizKeyUtils {
return Integer.parseInt(String.valueOf(new Date().getTime()).substring(0, 4));
}
public static String getCipher(String key) {
return md5(key + MIX_STRING + key);
public static String getCipher(String key,String initTime) {
return md5(key +"#"+ MIX_STRING + "#" + initTime);
}
public static Boolean validateCipher(String key,String cipher) {
return md5(key + MIX_STRING + key).equals(cipher);
public static Boolean validateCipher(String key,String initTime,String cipher) {
return md5(key +"#"+ MIX_STRING + "#" + initTime).equals(cipher);
}