public static byte [ ] doubleDigest ( byte [ ] input , int offset , int length ) { synchronized ( sha256digest ) { sha256digest . reset ( ) ; sha256digest . update ( input , offset , length ) ; byte [ ] first = sha256digest . digest ( ) ; return sha256digest . digest ( first ) ; } }
Calculates the SHA - 256 hash of the given byte range and then hashes the resulting hash again . This is standard procedure in Bitcoin . The resulting hash is in big endian form .