Code Duplication    Length = 21-21 lines in 2 locations

original/main.js 1 location

@@ 425-445 (lines=21) @@
422
	});
423
}
424
425
function shieldMix(addr) {
426
	let newAddr = "";
427
428
	for (let i = 0; i < 24; i++) {
429
		switch (addr.charAt(i)) {
430
			case '1':
431
				newAddr += "1iIlL".charAt(Math.floor(Math.random() * 5));
432
				break;
433
			case '0':
434
				newAddr += "0oO".charAt(Math.floor(Math.random() * 3));
435
				break;
436
			case 'w':
437
				newAddr += "VvWw".charAt(Math.floor(Math.random() * 4));
438
				break;
439
			default:
440
				newAddr += (Math.random() > 0.5) ? addr.charAt(i) : addr.charAt(i).toUpperCase();
441
		}
442
	}
443
444
	return newAddr;
445
}
446
447
function addAddress(num) {
448
	const addrTable = document.getElementById("tbody_opt_addr");

modern/main.js 1 location

@@ 255-275 (lines=21) @@
252
	});
253
}
254
255
function shieldMix(addr) {
256
	let newAddr = "";
257
258
	for (let i = 0; i < 24; i++) {
259
		switch (addr.charAt(i)) {
260
			case '1':
261
				newAddr += "1iIlL".charAt(Math.floor(Math.random() * 5));
262
				break;
263
			case '0':
264
				newAddr += "0oO".charAt(Math.floor(Math.random() * 3));
265
				break;
266
			case 'w':
267
				newAddr += "VvWw".charAt(Math.floor(Math.random() * 4));
268
				break;
269
			default:
270
				newAddr += (Math.random() > 0.5) ? addr.charAt(i) : addr.charAt(i).toUpperCase();
271
		}
272
	}
273
274
	return newAddr;
275
}
276
277
function addAddress(num) {
278
	const addrTable = document.getElementById("tbl_addrs");