public static boolean validateHash(byte[] hash1, byte[] hash2) {
        if (hash1 != null && hash2 != null && hash1.length == hash2.length) {
            for (int i = 0; i < hash1.length; i++) {
                if (hash1[i] != hash2[i]) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }