Skip to content

Instantly share code, notes, and snippets.

@hungtrn75
Created June 7, 2019 07:08
Show Gist options
  • Save hungtrn75/c1dfd5cb0dfcb1045c32970a69a127b5 to your computer and use it in GitHub Desktop.
Save hungtrn75/c1dfd5cb0dfcb1045c32970a69a127b5 to your computer and use it in GitHub Desktop.
m = [{
type: "amex",
pattern: /^3[47]/,
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
length: [15],
cvcLength: [4],
luhn: true
}, {
type: "jcb",
pattern: /^35/,
format: r,
length: [16],
cvcLength: [3],
luhn: true
}, {
type: "mastercard",
pattern: /^5[1-5]/,
format: r,
length: [16],
cvcLength: [3],
luhn: true
}, {
type: "visa",
pattern: /^4/,
format: r,
length: [13, 16],
cvcLength: [3],
luhn: true
}, {
type: "napas-abb",
pattern: /^(970425|191919)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-acb",
pattern: /^970416/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: false
}, {
type: "napas-bidv",
pattern: /^(970418|668899)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-bvb",
pattern: /^970438/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-ctg",
pattern: /^(970415|6201)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-dab",
pattern: /^(970406|1792)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-eib",
pattern: /^(970431|707070)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-gpb",
pattern: /^970408/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-hdb",
pattern: /^(970437|970420)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-ivb",
pattern: /^970434/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-klb",
pattern: /^970452/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-lpb",
pattern: /^970449/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-mb",
pattern: /^(970422|193939)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-msb",
pattern: /^970426/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-nab",
pattern: /^970428/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-nasb",
pattern: /^970409/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-ncb",
pattern: /^(970419|818188)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-ocb",
pattern: /^970448/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-ojb",
pattern: /^970414/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-pbvn",
pattern: /^970439/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-pgb",
pattern: /^970430/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-pvcb",
pattern: /^970412/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-scb",
pattern: /^970429/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-seab",
pattern: /^(970440|970468)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-shb",
pattern: /^970443/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-stb",
pattern: /^970403/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-tcb",
pattern: /^(970407|889988|888899)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-tpb",
pattern: /^970423/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-uob",
pattern: /^970458/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-vab",
pattern: /^970427/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-varb",
pattern: /^970405/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-vcb",
pattern: /^(970436|686868)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-vib",
pattern: /^(970441|180909|180906)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-vpb",
pattern: /^(970432|981957)/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-vrb",
pattern: /^970421/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}, {
type: "napas-woo",
pattern: /^970457/,
format: r,
length: [16, 19],
cvcLength: [0],
luhn: true
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment