/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.io.UnsupportedEncodingException
 *  java.lang.Object
 *  java.lang.String
 *  java.security.MessageDigest
 *  java.security.NoSuchAlgorithmException
 */
package com.xinli.portalclient.util;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Builder {
    static char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

    private static String byteToHexString(byte[] arrby) {
        char[] arrc = new char[32];
        int n = 0;
        int n2 = 0;
        while (n < 16) {
            byte by = arrby[n];
            int n3 = n2 + 1;
            arrc[n2] = hexDigits[15 & by >>> 4];
            n2 = n3 + 1;
            arrc[n3] = hexDigits[by & 15];
            ++n;
        }
        return new String(arrc);
    }

    public static String getMD5(String string2) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        return MD5Builder.byteToHexString(MessageDigest.getInstance((String)"MD5").digest(string2.getBytes("GBK")));
    }
}

