Android MD5 Encode encryptByUsingMd5(String passwd)

Here you can find the source of encryptByUsingMd5(String passwd)

Description

encrypt By Using Md

Declaration

public static String encryptByUsingMd5(String passwd) 

Method Source Code

//package com.java2s;
import java.security.MessageDigest;

public class Main {
    public static String encryptByUsingMd5(String passwd) {
        try {/* w w w.ja v  a2  s  .  com*/
            MessageDigest sha = MessageDigest.getInstance("MD5");
            byte[] tmp = passwd.getBytes();
            sha.update(tmp);
            return new String(sha.digest());

        } catch (java.security.NoSuchAlgorithmException e) {
            System.out.println("Rats, MD5 doesn't exist");
            System.out.println(e.toString());
        }
        return null;
    }
}

Related

  1. byteMd5(String plainText, Boolean is16)
  2. getMD5(byte[] source)
  3. md5(String string)
  4. createHMACWithMD5(String source, String key)
  5. md5(String text)
  6. md5(String input)
  7. isValidMD5String(String md5String)
  8. stringToMD5(String key)
  9. toMD5(final String toEncrypt)