Android MD5 Encode MD5(String md5)

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

Description

MD

Declaration

public static String MD5(String md5) 

Method Source Code

//package com.java2s;

public class Main {
    public static String MD5(String md5) {
        try {/*from w w  w  .  j  a v  a 2 s.  c om*/
            java.security.MessageDigest md = java.security.MessageDigest
                    .getInstance("MD5");
            byte[] array = md.digest(md5.getBytes());
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < array.length; ++i) {
                sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100)
                        .substring(1, 3));
            }
            return sb.toString();
        } catch (java.security.NoSuchAlgorithmException e) {
        }
        return null;
    }
}

Related

  1. computeHashMD5(final String text)
  2. getMD5String(File file)
  3. getMD5String(String str)
  4. getMd5(byte... values)
  5. checkDicMD5(String dicFile, final byte[] expected)
  6. getMD5Str(String str)
  7. MD5(String text)
  8. stringGetMD5String(String s)
  9. byteMd5(String plainText, Boolean is16)