Android MD5 Encode md5(String str)

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

Description

md

License

Apache License

Declaration

public static byte[] md5(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static byte[] md5(String str) {
        try {//  ww w  . j a va 2 s. c o m
            MessageDigest digest = MessageDigest.getInstance("md5");
            byte[] digested = digest.digest(str.getBytes());
            return digested;
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. md5(String input)
  2. md5(String ori)
  3. md5(String ori)
  4. md5(String s)
  5. md5(String s)
  6. md5(final String s)
  7. md5(final String s)
  8. md5(final String s)
  9. md5Byte(String in)