| | |
| | | |
| | | import com.se.system.domain.StaticData; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.security.MessageDigest; |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | return list; |
| | | } |
| | | |
| | | public static String md5(String str) { |
| | | if (str == null || str.length() == 0) return null; |
| | | |
| | | try { |
| | | MessageDigest md5 = MessageDigest.getInstance("MD5"); |
| | | md5.update(str.getBytes()); |
| | | byte[] byteArray = md5.digest(); |
| | | |
| | | BigInteger bigInt = new BigInteger(1, byteArray); |
| | | // 参数16表示16进制 |
| | | String result = bigInt.toString(16); |
| | | // 不足32位高位补零 |
| | | while (result.length() < 32) { |
| | | result = "0" + result; |
| | | } |
| | | return result; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | } |