Code Duplication    Length = 21-21 lines in 2 locations

original/main.js 1 location

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

modern/main.js 1 location

@@ 845-865 (lines=21) @@
842
	});
843
}
844
845
function shieldMix(addr) {
846
	let newAddr = "";
847
848
	for (let i = 0; i < 16; i++) {
849
		switch (addr.charAt(i)) {
850
			case '1':
851
				newAddr += "1iIlL".charAt(Math.floor(Math.random() * 5));
852
				break;
853
			case '0':
854
				newAddr += "0oO".charAt(Math.floor(Math.random() * 3));
855
				break;
856
			case 'w':
857
				newAddr += "VvWw".charAt(Math.floor(Math.random() * 4));
858
				break;
859
			default:
860
				newAddr += (Math.random() > 0.5) ? addr.charAt(i) : addr.charAt(i).toUpperCase();
861
		}
862
	}
863
864
	return newAddr;
865
}
866
867
function addAddress(num) {
868
	const addrTable = document.getElementById("tbl_addrs");