Java MD5 Byte Array md5(byte data[])

Here you can find the source of md5(byte data[])

Description

md

License

Open Source License

Declaration

public static byte[] md5(byte data[]) 

Method Source Code


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

public class Main {
    public static byte[] md5(byte data[]) {
        return getDigest().digest(data);
    }//  www  .  j  a v  a  2s  . c  o  m

    public static byte[] md5(String data) {
        return md5(data.getBytes());
    }

    static MessageDigest getDigest() {
        try {
            return MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }

    }
}

Related

  1. md5(byte data[])
  2. md5(byte[] buf)
  3. md5(byte[] buffer, int length)
  4. md5(byte[] bytes)