Java MD5 Hash md5Hash(String source)

Here you can find the source of md5Hash(String source)

Description

md Hash

License

Open Source License

Declaration

public static String md5Hash(String source) throws NoSuchAlgorithmException 

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 md5Hash(String source) throws NoSuchAlgorithmException {
        MessageDigest digest = MessageDigest.getInstance("MD5");
        digest.update(source.getBytes(), 0, source.length());
        return String.format("%032X", new BigInteger(1, digest.digest()));
    }/*from ww w .  jav  a  2  s.co  m*/
}

Related

  1. md5Hash(String content)
  2. md5Hash(String in)
  3. md5Hash(String input)
  4. md5hash(String key)
  5. md5hash(String pass)
  6. md5Hash(String text)
  7. md5HashBytesToBytes(byte[] buf)
  8. md5HashInt(String text)