Java SHA1 sha1(byte[] data)

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

Description

Gera resumo em algoritimo SHA1

License

Open Source License

Parameter

Parameter Description
data -> array de byte

Return

array de byte com o resumo gerado.

Declaration

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

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.security.MessageDigest;

public class Main {
    /**/*from  w  ww . j  a  v a2  s. c  o m*/
     * Gera resumo em algoritimo SHA1
     * @param data -> array de byte
     * @return array de byte com o resumo gerado.
     */
    public static byte[] sha1(byte[] data) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA1");
            md.update(data);
            return md.digest();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. SHA1(byte[] convertme)
  2. SHA1(byte[] data)
  3. sha1(byte[] data)
  4. sha1(byte[] data)
  5. sha1(byte[] data)
  6. SHA1(byte[] input)
  7. sha1(byte[] input)
  8. sha1(byte[] input)
  9. sha1(byte[] input)