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 0f99ee8 commit edf2b5f
Showing 1 changed file with 45 additions and 14 deletions.
59 changes: 45 additions & 14 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,28 +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 line = numberArray[i].trim();
const cardNumber = line.split("|")[0].trim(); // Extract card number

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)) {
if (!isValidCreditCard(cardNumber)) {
muradList.push(`<span style='color:grey; font-weight:bold;'>Invalid (Luhn Check)</span> | ${line} /OshekherO`);
continue;
}

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);
const randomZero1 = Math.floor(Math.random() * 0); // This will always be 0
const randomZero2 = Math.floor(Math.random() * 0); // This will also always be 0

// Output includes the full line (including expiration and CVV)
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;'>$" + randomFour + "," + randomTen + "</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;'>$" + randomZero1 + "," + randomZero2 + "</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");
}
}

Expand All @@ -67,15 +92,21 @@ checkBtn.addEventListener("click", function () {
if (i < muhammadList.length) {
muhammadCount++;
muhammadNumbersDiv.innerHTML += muhammadList[i] + "<br>";
document.getElementById("muhammad-count").innerHTML = "Checked: " + muhammadCount;
document.getElementById("muhammad-count").innerHTML =
"Checked: " + muhammadCount;
}
if (i < muradList.length) {
muradCount++;
muradNumbersDiv.innerHTML += muradList[i] + "<br>";
document.getElementById("murad-count").innerHTML = "Checked: " + muradCount;
document.getElementById("murad-count").innerHTML =
"Checked: " + muradCount;
}
i++;
if (i >= aliList.length && i >= muhammadList.length && i >= muradList.length) {
if (
i >= aliList.length &&
i >= muhammadList.length &&
i >= muradList.length
) {
clearInterval(updateNumbers);
Swal.fire({
title: "Checking completed!",
Expand Down

0 comments on commit edf2b5f

Please sign in to comment.