src/com/my/pro/utils/RandomCreditCardNumberGenerator.java
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.my.pro.utils;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
public class RandomCreditCardNumberGenerator {
public static final String[] VISA_PREFIX_LIST = new String[] { "4539",
"4556", "4916", "4532", "4929", "40240071", "4485", "4716", "4" };
public static final String[] MASTERCARD_PREFIX_LIST = new String[] { "51",
"52", "53", "54", "55" };
public static final String[] AMEX_PREFIX_LIST = new String[] { "34", "37" };
public static final String[] DISCOVER_PREFIX_LIST = new String[] { "6011" };
public static final String[] DINERS_PREFIX_LIST = new String[] { "300",
"301", "302", "303", "36", "38" };
public static final String[] ENROUTE_PREFIX_LIST = new String[] { "2014",
"2149" };
public static final String[] JCB_PREFIX_LIST = new String[] { "35" };
public static final String[] VOYAGER_PREFIX_LIST = new String[] { "8699" };
static String strrev(String str) {
if (str == null)
return "";
String revstr = "";
for (int i = str.length() - 1; i >= 0; i--) {
revstr += str.charAt(i);
}
return revstr;
}
/*
* 'prefix' is the start of the CC number as a string, any number of digits.
* 'length' is the length of the CC number to generate. Typically 13 or 16
*/
static String completed_number(String prefix, int length) {
String ccnumber = prefix;
// generate digits
while (ccnumber.length() < (length - 1)) {
ccnumber += new Double(Math.floor(Math.random() * 10)).intValue();
}
// reverse number and convert to int
String reversedCCnumberString = strrev(ccnumber);
List<Integer> reversedCCnumberList = new Vector<Integer>();
for (int i = 0; i < reversedCCnumberString.length(); i++) {
reversedCCnumberList.add(new Integer(String
后面还有 103 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。