Java MD5 Byte Array MD5Bytes(byte[] src)

Here you can find the source of MD5Bytes(byte[] src)

Description

MD Bytes

License

Open Source License

Declaration

public static byte[] MD5Bytes(byte[] src) 

Method Source Code

//package com.java2s;
/**//from  w  w w.ja va2s . c  om
 *  Copyright (c)  2016-2020 Weibo, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Weibo, 
 *  Inc. ("Confidential Information"). You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into with Weibo.
 */

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

public class Main {

    public static byte[] MD5Bytes(byte[] src) {
        byte[] result = null;
        if (src != null) {
            try {
                MessageDigest alg = MessageDigest.getInstance("MD5");
                result = alg.digest(src);
            } catch (NoSuchAlgorithmException e) {

            }
        }
        return result;
    }
}

Related

  1. md5(byte[] str)
  2. md5(final byte[] b)
  3. md5(final byte[] bytes)
  4. md5(final byte[] data)
  5. md5Byte(String encryptStr)
  6. md5Bytes(String message)
  7. md5Bytes(String s)
  8. md5Digest(byte[] bytes)
  9. md5Hex(byte data[])