Here you can find the source of sha1(byte[] data)
Parameter | Description |
---|---|
data | -> array de byte |
public static byte[] sha1(byte[] data)
//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; } } }