BrU32

JS Luhn Mass Lookup+Gen FINAL RELEASE!!!!!

Aug 14th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <center><textarea id="t" style="height:20;width:150">100</textarea><p>
  2. <button onclick="fun()">Gen CC Numbers Now</button>
  3. <script>
  4. function fun(){
  5. var valcnt=0;
  6. function luhnCheckDigit(number){
  7. var validChars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
  8. number = number.toUpperCase().trim();
  9. var sum=0;
  10. for(var i=0;i<number.length;i++){
  11. var ch=number.charAt(number.length-i-1);
  12. if(validChars.indexOf(ch)<0){
  13. alert("Invalid Chars Found!!");
  14. return false;
  15. }
  16. var digit=ch.charCodeAt(0)-48;
  17. var weight;
  18. if(ch%2==0){
  19. weight=(2*digit)-parseInt(digit/5)*9;
  20. }else{
  21. weight=digit;
  22. }
  23. sum+=weight;
  24. }
  25. sum=Math.abs(sum)+10;
  26. var digit=(10 -(sum%10))%10;
  27. return digit;
  28. }
  29. var amm=t.value;
  30. var orig=amm;
  31. while(amm!=0){
  32. amm--;
  33. var inn=Math.floor(Math.random()*9999999999999999);
  34. //var inn=prompt("Enter Any Credit Card #:");
  35. var out=luhnCheckDigit(""+inn);
  36. if(out==0){
  37. valcnt++;
  38. var outs=(inn)+"<br>"+outs;
  39.  
  40. }else{
  41. //alert(inn);
  42. //alert("Invalid Credit Card #!!","","Invalid Number!!");
  43. }
  44. }
  45. if(outs!=undefined){
  46. var clean=outs.replace("undefined","");
  47. document.write(clean);
  48. }
  49. if(valcnt==1){
  50. alert(valcnt+ " Valid Number Generated From "+orig+" Attempts!!");
  51. }else{
  52. alert(valcnt+ " Valid Numbers Generated From "+orig+" Attempts!!");
  53. }
  54. }
  55. </script>
  56. </center.>
Advertisement
Add Comment
Please, Sign In to add comment