Java MD5 String md5(String str)

Here you can find the source of md5(String str)

Description

md

License

Apache License

Declaration

public static final byte[] md5(String str) 

Method Source Code

//package com.java2s;
/*/*from w  ww .  j a v  a  2 s  .  com*/
 * BJAF - Beetle J2EE Application Framework
 * ???J2EE???????????
 * ??????2003-2015 ??? (www.beetlesoft.net)
 * 
 * ??????????????????
 *<http://www.apache.org/licenses/LICENSE-2.0>
 *????????????????????????
 *
 * ???????????????????????????????
 * ??? <yuhaodong@gmail.com/>.
 */

import java.security.NoSuchAlgorithmException;

public class Main {
    public static final byte[] md5(String str) {

        java.security.MessageDigest digest;
        try {
            digest = java.security.MessageDigest.getInstance("MD5");
            return digest.digest(str.getBytes());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. md5(String str)
  2. md5(String str)
  3. md5(String str)
  4. MD5(String str)
  5. md5(String str)
  6. md5(String str)
  7. MD5(String str)
  8. MD5(String str)
  9. md5(String str)