public static byte[] doubleDigestTwoBuffers(byte[] input1,int offset1,int length1,byte[] input2,int offset2,int length2){
synchronized (digest) {
    digest.reset();
    digest.update(input1,offset1,length1);
    digest.update(input2,offset2,length2);
    byte[] first=digest.digest();
    return digest.digest(first);
  }
}

public static byte [ ] doubleDigestTwoBuffers ( byte [ ] input1 , int offset1 , int length1 , byte [ ] input2 , int offset2 , int length2 ) { synchronized ( digest ) { digest . reset ( ) ; digest . update ( input1 , offset1 , length1 ) ; digest . update ( input2 , offset2 , length2 ) ; byte [ ] first = digest . digest ( ) ; return digest . digest ( first ) ; } }
calculates sha256 ( sha256 ( byte range 1 + byte range 2 ) ) .
