MD5Util { public static String getMD5(String str) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(str.getBytes()); return new BigInteger(1, md.digest()).toString(16); } catch (Exception e) { throw new RuntimeException("MD5加密出现错误"); } }  static String getMD5(String str);  }
@Test public void getMD5() throws Exception { System.out.println(MD5Util.getMD5("xujiaji")); }