@Test void toMd5() { }
public String toMd5(String origin){ String re_md5 = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes()); byte b[] = md.digest(); md = null; int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) { i += 256; } if (i < 16) { buf.append("0"); } buf.append(Integer.toHexString(i)); } re_md5 = buf.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return re_md5; }
MD5Util { public String toMd5(String origin){ String re_md5 = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes()); byte b[] = md.digest(); md = null; int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) { i += 256; } if (i < 16) { buf.append("0"); } buf.append(Integer.toHexString(i)); } re_md5 = buf.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return re_md5; } }
MD5Util { public String toMd5(String origin){ String re_md5 = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes()); byte b[] = md.digest(); md = null; int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) { i += 256; } if (i < 16) { buf.append("0"); } buf.append(Integer.toHexString(i)); } re_md5 = buf.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return re_md5; } private  MD5Util(); }
MD5Util { public String toMd5(String origin){ String re_md5 = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes()); byte b[] = md.digest(); md = null; int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) { i += 256; } if (i < 16) { buf.append("0"); } buf.append(Integer.toHexString(i)); } re_md5 = buf.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return re_md5; } private  MD5Util(); static MD5Util getInstance(); String toMd5(String origin); }
MD5Util { public String toMd5(String origin){ String re_md5 = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes()); byte b[] = md.digest(); md = null; int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) { i += 256; } if (i < 16) { buf.append("0"); } buf.append(Integer.toHexString(i)); } re_md5 = buf.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return re_md5; } private  MD5Util(); static MD5Util getInstance(); String toMd5(String origin);  }