|
|
|
@@ -91,7 +91,7 @@ public class HashUtil { |
|
|
|
} |
|
|
|
try { |
|
|
|
String enc = hash("md5", str); |
|
|
|
enc = new String(Base64.getUrlEncoder().encode(enc.getBytes("utf-8"))); |
|
|
|
enc = new String(Base64.getUrlEncoder().encode(enc.getBytes("utf-8")), "utf-8"); |
|
|
|
return enc; |
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
return null; |
|
|
|
@@ -102,7 +102,13 @@ public class HashUtil { |
|
|
|
if (str == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
String dec = new String(Base64.getUrlDecoder().decode(str)); |
|
|
|
return dec; |
|
|
|
try { |
|
|
|
String dec = new String(Base64.getUrlDecoder().decode(str), "utf-8"); |
|
|
|
return dec; |
|
|
|
} catch (Exception e) { |
|
|
|
System.out.println(str); |
|
|
|
System.out.println(e.getMessage()); |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |