function hashDifficulty(bytes32 hash) public pure returns(uint) {
        uint diff = 0;

        for (uint i=0;i<32;i++) {
            if (hash[i] == 0) {
                diff++;
            } else {
                return diff;
            }
        }

        return diff;
    }