package quant.rich.emoney.util;

import java.nio.charset.Charset;

/* r2.b */
public class EmoneyBytesResortUtils {

    /* renamed from: a reason: collision with root package name */
    private static char[] f42522a = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };

    public static int a(int i9) {
        int i10 = 0;
        while (i9 != 0) {
            i10++;
            i9 &= i9 - 1;
        }
        return i10;
    }

    private static int b() {
        return 26895494;
    }

    private static int c() {
        return 35063394;
    }

    public static void d(byte[] bArr) {
        int length = bArr.length;
        byte[] bytes = Integer.valueOf(b() + c()).toString().getBytes(Charset.forName("UTF-8"));
        int length2 = bytes.length;
        int i9 = 0;
        do {
            for (int i10 = 0; i10 < length2; i10++) {
                int i11 = i9 + i10;
                if (i11 >= length) {
                    break;
                }
                bArr[i11] = (byte) (bArr[i11] ^ bytes[i10]);
            }
            i9 += length2;
        } while (i9 < length);
    }

    public static String[] e(String str, int i9) {
        int i10;
        String str2;
        int length = str.length() / i9;
        int length2 = str.length() % i9;
        if (length2 != 0) {
            i10 = 1;
        } else {
            i10 = 0;
        }
        int i11 = length + i10;
        String[] strArr = new String[i11];
        for (int i12 = 0; i12 < i11; i12++) {
            if (i12 != i11 - 1 || length2 == 0) {
                int i13 = i12 * i9;
                str2 = str.substring(i13, i13 + i9);
            } else {
                int i14 = i12 * i9;
                str2 = str.substring(i14, i14 + length2);
            }
            strArr[i12] = str2;
        }
        return strArr;
    }

}
