Java MD5 String MD5String(String str)

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

Description

MD String

License

Open Source License

Declaration

public static String MD5String(String str) throws NoSuchAlgorithmException 

Method Source Code


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

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    public static String MD5String(String str) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("MD5");
        md.update(str.getBytes());/*w w  w. jav  a 2  s.c  o  m*/
        byte[] digest = md.digest();
        StringBuffer sb = new StringBuffer();
        for (byte b : digest) {
            sb.append(Integer.toHexString((int) (b & 0xff)));
        }
        return sb.toString();
    }
}

Related

  1. md5String(String input)
  2. md5String(String key)
  3. md5String(String paramString)
  4. md5String(String s)
  5. md5String(String s)
  6. MD5StringToL32(String md5Str)
  7. MD5ToInt(String s)
  8. md5Util(String password)