MCPcopy Create free account
hub / github.com/DanWahlin/CustomerManagerStandard / luhn

Function luhn

CustomerManager/Scripts/breeze.debug.js:2738–2742  ·  view source on GitHub ↗
(a, b, c, d, e)

Source from the content-addressed store, hash-verified

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

Callers 1

valFnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected