Here you can find the source of sha1(byte[] data)
public static byte[] sha1(byte[] data)
//package com.java2s; //License from project: Apache License import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.security.ProviderException; public class Main { public static byte[] sha1(byte[] data) { try {/*from w w w. j a v a2s . com*/ MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(data); return md.digest(); } catch (GeneralSecurityException e) { throw new ProviderException(e.getMessage()); } } }