Here you can find the source of sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc)
public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; public class Main { public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md;/* w ww .j av a2 s. co m*/ md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; } public static byte[] sha1sum(byte[] data) throws NoSuchAlgorithmException { return sha1sum(data, null, null); } }