Java MD5 String md5(String input)

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

Description

md

License

Open Source License

Declaration

public static String md5(String input) throws Exception 

Method Source Code

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

import java.math.BigInteger;

import java.security.MessageDigest;

public class Main {
    public static String md5(String input) throws Exception {
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        md5.update(input.getBytes("UTF-8"));
        BigInteger hash = new BigInteger(1, md5.digest());
        return String.format("%1$032X", hash);
    }/*w w w .j  av a  2  s.  c  om*/
}

Related

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