@Test public void testAll() { long starttime = System.currentTimeMillis(); try { for (int i = 0; i < 10000; i++) { assertNotNull(CryptoUtil.encrypt(System.currentTimeMillis() + "4--]tFyI;hU!'ct^+c}swatano")); } } catch (Exception e) { assertNotNull(e); } LOG.debug("total time:" + (System.currentTimeMillis() - starttime) + "ms"); }
public static String encrypt(String strSrc) { MessageDigest md = null; String strDes = null; byte[] bt = strSrc.getBytes(); try { md = MessageDigest.getInstance(Algorithm2); md.update(bt); strDes = byte2hex(md.digest()); } catch (NoSuchAlgorithmException e) { LOG.error("Invalid algorithm.", e); return null; } return strDes; }
CryptoUtil { public static String encrypt(String strSrc) { MessageDigest md = null; String strDes = null; byte[] bt = strSrc.getBytes(); try { md = MessageDigest.getInstance(Algorithm2); md.update(bt); strDes = byte2hex(md.digest()); } catch (NoSuchAlgorithmException e) { LOG.error("Invalid algorithm.", e); return null; } return strDes; } }
CryptoUtil { public static String encrypt(String strSrc) { MessageDigest md = null; String strDes = null; byte[] bt = strSrc.getBytes(); try { md = MessageDigest.getInstance(Algorithm2); md.update(bt); strDes = byte2hex(md.digest()); } catch (NoSuchAlgorithmException e) { LOG.error("Invalid algorithm.", e); return null; } return strDes; }  }
CryptoUtil { public static String encrypt(String strSrc) { MessageDigest md = null; String strDes = null; byte[] bt = strSrc.getBytes(); try { md = MessageDigest.getInstance(Algorithm2); md.update(bt); strDes = byte2hex(md.digest()); } catch (NoSuchAlgorithmException e) { LOG.error("Invalid algorithm.", e); return null; } return strDes; }  static String encode(String input); static String decode(String input); static String encrypt(String strSrc); static String encodeLongToString(long i); static long decodeStringToLong(String s); }
CryptoUtil { public static String encrypt(String strSrc) { MessageDigest md = null; String strDes = null; byte[] bt = strSrc.getBytes(); try { md = MessageDigest.getInstance(Algorithm2); md.update(bt); strDes = byte2hex(md.digest()); } catch (NoSuchAlgorithmException e) { LOG.error("Invalid algorithm.", e); return null; } return strDes; }  static String encode(String input); static String decode(String input); static String encrypt(String strSrc); static String encodeLongToString(long i); static long decodeStringToLong(String s);  }