package com.cvte.dss.ups.dth_typc;

import android.text.TextUtils;
import f.a.y.a;
import g.h0.c.l;
import j.b0;
import j.d;
import j.n;
import java.io.File;
import java.io.IOException;

/* JADX INFO: loaded from: classes.dex */
public class MessageDigestUtils {
    private static final String TAG = "MessageDigestUtils";

    public static boolean equals(String str, String str2) {
        return (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || !str.trim().equalsIgnoreCase(str2.trim())) ? false : true;
    }

    public static String getMd5(File file) {
        d dVar = new d();
        try {
            try {
                b0 b0VarV0 = a.V0(file);
                l.f(b0VarV0, "source");
                n nVar = new n(b0VarV0, "MD5");
                while (nVar.read(dVar, 8192L) != -1) {
                    dVar.K(dVar.f4601e);
                }
                return nVar.a().d();
            } catch (IOException e2) {
                e2.printStackTrace();
                return "";
            }
        } catch (Throwable th) {
            throw th;
        }
    }

    @Deprecated
    public static String wrapMd5(String str) {
        int length;
        if (TextUtils.isEmpty(str) || (length = 32 - str.length()) <= 0) {
            return str;
        }
        StringBuilder sb = new StringBuilder();
        while (true) {
            int i2 = length - 1;
            if (length == 0) {
                sb.append(str);
                return sb.toString();
            }
            sb.append("0");
            length = i2;
        }
    }
}
