package o; import java.util.Collection; import java.util.Collections; /* loaded from: classes2.dex */ public final class upP extends Ggl { @Override // o.Ggl protected final Collection b() { return Collections.singleton(PTS.CODE_93); } private static int d(boolean[] zArr, int i, int i2) { for (int i3 = 0; i3 < 9; i3++) { boolean z = true; if (((1 << (8 - i3)) & i2) == 0) { z = false; } zArr[i + i3] = z; } return 9; } private static int d(String str, int i) { int i2 = 0; int i3 = 1; for (int length = str.length() - 1; length >= 0; length--) { i2 += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*".indexOf(str.charAt(length)) * i3; i3++; if (i3 > i) { i3 = 1; } } return i2 % 47; } @Override // o.Ggl public final boolean[] d(String str) { int length = str.length(); StringBuilder sb = new StringBuilder(length << 1); for (int i = 0; i < length; i++) { char charAt = str.charAt(i); if (charAt == 0) { sb.append("bU"); } else if (charAt <= 26) { sb.append('a'); sb.append((char) (charAt + '@')); } else if (charAt <= 31) { sb.append('b'); sb.append((char) (charAt + '&')); } else if (charAt == ' ' || charAt == '$' || charAt == '%' || charAt == '+') { sb.append(charAt); } else if (charAt <= ',') { sb.append('c'); sb.append((char) (charAt + ' ')); } else if (charAt <= '9') { sb.append(charAt); } else if (charAt == ':') { sb.append("cZ"); } else if (charAt <= '?') { sb.append('b'); sb.append((char) (charAt + 11)); } else if (charAt == '@') { sb.append("bV"); } else if (charAt <= 'Z') { sb.append(charAt); } else if (charAt <= '_') { sb.append('b'); sb.append((char) (charAt - 16)); } else if (charAt == '`') { sb.append("bW"); } else if (charAt <= 'z') { sb.append('d'); sb.append((char) (charAt - ' ')); } else if (charAt <= 127) { sb.append('b'); sb.append((char) (charAt - '+')); } else { StringBuilder sb2 = new StringBuilder("Requested content contains a non-encodable character: '"); sb2.append(charAt); sb2.append("'"); throw new IllegalArgumentException(sb2.toString()); } } String obj = sb.toString(); int length2 = obj.length(); if (length2 > 80) { throw new IllegalArgumentException("Requested contents should be less than 80 digits long after converting to extended encoding, but got ".concat(String.valueOf(length2))); } boolean[] zArr = new boolean[((obj.length() + 4) * 9) + 1]; int d = d(zArr, 0, IiO.b); for (int i2 = 0; i2 < length2; i2++) { d += d(zArr, d, IiO.e["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*".indexOf(obj.charAt(i2))]); } int d2 = d(obj, 20); int d3 = d + d(zArr, d, IiO.e[d2]); StringBuilder sb3 = new StringBuilder(); sb3.append(obj); sb3.append("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*".charAt(d2)); int d4 = d3 + d(zArr, d3, IiO.e[d(sb3.toString(), 15)]); d(zArr, d4, IiO.b); zArr[d4 + 9] = true; return zArr; } }