Android Byte Array Digest digest(byte[] input, String algoritmo)

Here you can find the source of digest(byte[] input, String algoritmo)

Description

digest

Declaration


public static byte[] digest(byte[] input, String algoritmo)
        throws NoSuchAlgorithmException 

Method Source Code

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

public class Main {

    public static byte[] digest(byte[] input, String algoritmo)
            throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance(algoritmo);
        md.reset();/*ww  w  .  ja v  a 2  s  .  c om*/
        return md.digest(input);
    }
}