MCPcopy Create free account
hub / github.com/SEBV1/idlefish_monitor / encode

Method encode

src/main/java/com/github/utils/Base64.java:167–255  ·  view source on GitHub ↗
(byte[] bArr)

Source from the content-addressed store, hash-verified

165 }
166
167 public static String encode(byte[] bArr) {
168 if (bArr == null) {
169 return null;
170 }
171 int length = bArr.length * 8;
172 if (length == 0) {
173 return "";
174 }
175 int i = length % 24;
176 int i2 = length / 24;
177 char[] cArr = new char[(i != 0 ? i2 + 1 : i2) * 4];
178 int i3 = 0;
179 int i4 = 0;
180 int i5 = 0;
181 while (i3 < i2) {
182 int i6 = i4 + 1;
183 byte b = bArr[i4];
184 int i7 = i6 + 1;
185 byte b2 = bArr[i6];
186 int i8 = i7 + 1;
187 byte b3 = bArr[i7];
188 byte b4 = (byte) (b2 & 15);
189 byte b5 = (byte) (b & 3);
190 int i9 = b & Byte.MIN_VALUE;
191 int i10 = b >> 2;
192 if (i9 != 0) {
193 i10 ^= 192;
194 }
195 byte b6 = (byte) i10;
196 int i11 = b2 & Byte.MIN_VALUE;
197 int i12 = b2 >> 4;
198 if (i11 != 0) {
199 i12 ^= 240;
200 }
201 byte b7 = (byte) i12;
202 int i13 = (b3 & Byte.MIN_VALUE) == 0 ? b3 >> 6 : (b3 >> 6) ^ 252;
203 int i14 = i5 + 1;
204 char[] cArr2 = lookUpBase64Alphabet;
205 cArr[i5] = cArr2[b6];
206 int i15 = i14 + 1;
207 cArr[i14] = cArr2[(b5 << 4) | b7];
208 int i16 = i15 + 1;
209 cArr[i15] = cArr2[(b4 << 2) | ((byte) i13)];
210 cArr[i16] = cArr2[b3 & 63];
211 i3++;
212 i5 = i16 + 1;
213 i4 = i8;
214 }
215 if (i == 8) {
216 byte b8 = bArr[i4];
217 byte b9 = (byte) (b8 & 3);
218 int i17 = b8 & Byte.MIN_VALUE;
219 int i18 = b8 >> 2;
220 if (i17 != 0) {
221 i18 ^= 192;
222 }
223 int i19 = i5 + 1;
224 char[] cArr3 = lookUpBase64Alphabet;

Callers 15

encryptMethod · 0.95
signMethod · 0.95
DzFunction · 0.80
IzFunction · 0.80
createParserFunction · 0.80
renderFunction · 0.80
encodeTextFunction · 0.80
ZhFunction · 0.80
applyInfoFunction · 0.80
theme.min.jsFile · 0.80
dataToHtmlFunction · 0.80
jFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected