Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
OshekharO authored Jul 13, 2024
1 parent b7dff0e commit 3e414e8
Showing 1 changed file with 41 additions and 18 deletions.
59 changes: 41 additions & 18 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ const stopCheckBtn = document.getElementById("stop-check-btn");

let updateNumbers;

// Function to perform Luhn check (standard and Amex)
function isValidCreditCard(number) {
// Remove non-digit characters
number = number.replace(/\D/g, '');

// Check if it's potentially a valid credit card number
if (!/^(?:3[47][0-9]{13}|4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/.test(number)) {
return false;
}

let sum = 0;
let alternate = false;
for (let i = number.length - 1; i >= 0; i--) {
let n = parseInt(number.substring(i, i + 1));
if (alternate) {
n *= 2;
if (n > 9) {
n = (n % 10) + 1;
}
}
sum += n;
alternate = !alternate;
}
return (sum % 10) === 0;
}

checkBtn.addEventListener("click", function () {
const numbers = document.getElementById("numbers").value;
const numberArray = numbers.split("\n").filter((number) => {
Expand All @@ -26,30 +52,27 @@ checkBtn.addEventListener("click", function () {
let muradList = [];

for (let i = 0; i < numberArray.length; i++) {
const number = numberArray[i].trim();
const firstDigit = number.charAt(0);
const secondDigit = number.charAt(1);
const thirdDigit = number.charAt(2);

const validPattern = /^\d{16}\|\s*\d{2}\|\s*\d{4}\|\s*\d{3}$|^\d{15}\|\s*\d{2}\|\s*\d{4}\|\s*\d{4}$|^\d{14}\|\s*\d{2}\|\s*\d{4}\|\s*\d{4}$/;
if (!validPattern.test(number)) {
continue;
const line = numberArray[i].trim();
const cardNumber = line.split("|")[0].trim();

// CORRECTED LOGIC:
// 1. Perform Luhn check FIRST
if (!isValidCreditCard(cardNumber)) {
muradList.push(`<span style='color:grey; font-weight:bold;'>Invalid (Luhn Check)</span> | ${line} /OshekherO`);
// If invalid, continue to the next card
continue;
}

// 2. If valid, THEN categorize based on the random number
const randomNumber = Math.random();
const randomFour = Math.floor(Math.random() * 4);
const randomTen = Math.floor(Math.random() * 10);
const randomZero1 = Math.floor(Math.random() * 0);
const randomZero2 = Math.floor(Math.random() * 0);

if (randomNumber < 0.2) {
aliList.push("<span style='color:green; font-weight:bold;'>Live</span> | " + number + " -> [Charge <span style='color:green; font-weight:bold;'>$" + randomFour + "," + randomTen + "</span>] [GATE:01]. /OshekherO");
aliList.push(`<span style='color:green; font-weight:bold;'>Live</span> | ${line} -> [Charge <span style='color:green; font-weight:bold;'>$4,99</span>] [GATE:01]. /OshekherO`);
} else if (randomNumber < 0.9) {
muhammadList.push("<span style='color:red; font-weight:bold;'>Dead</span> | " + number + " -> [Charge <span style='color:red; font-weight:bold;'>$" + randomZero1 + "," + randomZero2 + "</span>] [GATE:01]. /OshekherO");
muhammadList.push(`<span style='color:red; font-weight:bold;'>Dead</span> | ${line} -> [Charge <span style='color:red; font-weight:bold;'>$0,00</span>] [GATE:01]. /OshekherO`);
} else {
muradList.push("<span style='color:orange; font-weight:bold;'>Unknown</span> | " + number + " -> [Charge <span style='color:orange; font-weight:bold;'>N/A</span>] [GATE:01]. /OshekherO");
muradList.push(`<span style='color:orange; font-weight:bold;'>Unknown</span> | ${line} -> [Charge <span style='color:orange; font-weight:bold;'>N/A</span>] [GATE:01]. /OshekherO`);
}
}
}

let aliCount = 0;
let muhammadCount = 0;
Expand Down Expand Up @@ -87,7 +110,7 @@ checkBtn.addEventListener("click", function () {
stopCheckBtn.disabled = true;
document.getElementById("numbers").value = "";
}
}, Math.floor(Math.random() * (maxDelay - minDelay + 1) + minDelay));
}, Math.floor(Math.random() * (maxDelay - minDelay + 1) + minDelay));
});

// copy buttons
Expand Down

0 comments on commit 3e414e8

Please sign in to comment.