Java MD5 String md5(String password)

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

Description

md

License

Open Source License

Declaration

public static String md5(String password) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static String md5(String password) {
        String pass = "";
        MessageDigest md = null;/*from   w  w w  . jav a  2  s  .c o  m*/
        try {
            md = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        BigInteger hash = new BigInteger(1, md.digest(password.getBytes()));
        pass = hash.toString(16);
        return pass;
    }
}

Related

  1. md5(String message)
  2. md5(String message)
  3. md5(String orgin)
  4. md5(String pass)
  5. md5(String password)
  6. md5(String password)
  7. md5(String path_of_file_)
  8. MD5(String pData)
  9. md5(String plain)