Java MD5 String md5(String str)

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

Description

md

License

Apache License

Declaration

public static String md5(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;
import java.security.MessageDigest;

public class Main {
    public static String md5(String str) {
        try {/*from w w w  .  j  a  v  a2  s .  c  o m*/
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(str.getBytes());
            return new BigInteger(1, md.digest()).toString(16);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return str;
    }
}

Related

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