Make MD5 byte array from String - Android java.security

Android examples for java.security:MD5

Description

Make MD5 byte array from String

Demo Code

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

public class Main{

    public static byte[] makeMD5(String param) {
        byte[] digest = null;
        try {//from w  w  w.  j  a  v a  2 s. c  o  m
            digest = MessageDigest.getInstance("MD5").digest(
                    param.getBytes());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return digest;
    }

}

Related Tutorials