Here you can find the source of sha1Encode(byte[] content)
public static byte[] sha1Encode(byte[] content) throws NoSuchAlgorithmException, InvalidKeyException
//package com.java2s; //License from project: Apache License import java.security.InvalidKeyException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] sha1Encode(byte[] content) throws NoSuchAlgorithmException, InvalidKeyException { MessageDigest md = MessageDigest.getInstance("SHA"); byte[] mdRes = md.digest(content); return mdRes; }//from w w w.j ava 2 s . c o m }