public static long createHash(byte[] data) {
        long h = 0;
        byte[] res;

        synchronized (digestFunction) {
            res = digestFunction.digest(data);
        }

        for (int i = 0; i < 4; i++) {
            h <<= 8;
            h |= ((int) res[i]) & 0xFF;
        }
        return h;
    }
public static long createHash ( byte [ ] data ) { long h = 0 ; byte [ ] res ; synchronized ( digestFunction ) { res = digestFunction . digest ( data ) ; } for ( int i = 0 ; i < 4 ; i ++ ) { h <<= 8 ; h |= ( ( int ) res [ i ] ) & 0xFF ; } return h ; }
Generates a digest based on the contents of an array of bytes.

@param data specifies input data.
@return digest as long.