Here you can find the source of calculateSHA1(byte[] data)
public static byte[] calculateSHA1(byte[] data)
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] calculateSHA1(byte[] data) { try {/*from ww w . j a va 2 s. c om*/ MessageDigest md = MessageDigest.getInstance("SHA1"); return md.digest(data); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } }