(a, b, c, d, e)
| 2736 | |
| 2737 | // http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#JavaScript |
| 2738 | function luhn(a, b, c, d, e) { |
| 2739 | for (d = +a[b = a.length - 1], e = 0; b--;) |
| 2740 | c = +a[b], d += ++e % 2 ? 2 * c % 10 + (c > 4) : c; |
| 2741 | return !(d % 10); |
| 2742 | }; |
| 2743 | |
| 2744 | /** |
| 2745 | Returns a regular expression validator; the expression must be specified |