public static byte[] hash(byte[] input,int offset,int length){
  MessageDigest digest=newDigest();
  digest.update(input,offset,length);
  return digest.digest();
}

public static byte [ ] hash ( byte [ ] input , int offset , int length ) { MessageDigest digest = newDigest ( ) ; digest . update ( input , offset , length ) ; return digest . digest ( ) ; }
calculates the sha - 256 hash of the given byte range .
