Here you can find the source of SHA1(byte[] bytes)
public static byte[] SHA1(byte[] bytes)
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] SHA1(byte[] bytes) { return digest("SHA-1", bytes); }/*w ww . j a va 2s. co m*/ private static byte[] digest(String type, byte[] bytes) { try { MessageDigest dist = MessageDigest.getInstance(type); return dist.digest(bytes); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("Cannot find digest:" + type, e); } } }