java MD5

public static final String EncoderPwdByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException { 

  MessageDigest md5 = MessageDigest.getInstance("MD5");

  BASE64Encoder base64en = new BASE64Encoder();

  String newstr = base64en.encode(md5.digest(str.getBytes("utf-8")));

  return newstr;

}

posted @ 2013-04-16 22:36  S&L·chuck  阅读(190)  评论(0编辑  收藏  举报