Android MD5 Encode computeMd5Hash(byte[] in)

Here you can find the source of computeMd5Hash(byte[] in)

Description

Compute the MD5 hash of the byte array provided.

License

Open Source License

Parameter

Parameter Description
in the byte array to hash

Return

the MD5 hash of the byte array

Declaration

public static byte[] computeMd5Hash(byte[] in) 

Method Source Code

//package com.java2s;

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

public class Main {
    /**/*w  w w. j  ava  2  s . c  o m*/
     * Compute the MD5 hash of the byte array provided. Does not accumulate
     * input.
     * @param in the byte array to hash
     * @return the MD5 hash of the byte array
     */
    public static byte[] computeMd5Hash(byte[] in) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            return md5.digest(in);
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. md5(final String s)
  2. md5(final String s)
  3. hexMD5(String input)
  4. getMD5(String str)
  5. getMD5Digest(String str)
  6. MD5(String md5)
  7. MD5(String text)
  8. md5(File input)
  9. md5(String input)