Server : LiteSpeed System : Linux premium163.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : infihsqw ( 644) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/infihsqw/xtramobile-ae.store/controlPanel/assets/plugins/parsleyjs/src/extra/validator/ |
// luhn extra validators window.ParsleyConfig = window.ParsleyConfig || {}; window.ParsleyConfig.validators = window.ParsleyConfig.validators || {}; window.ParsleyConfig.validators.luhn = { fn: function (value) { value = value.replace(/[ -]/g, ''); var digit, n, sum, _j, _len1, _ref2; sum = 0; _ref2 = value.split('').reverse(); for (n = _j = 0, _len1 = _ref2.length; _j < _len1; n = ++_j) { digit = _ref2[n]; digit = +digit; if (n % 2) { digit *= 2; if (digit < 10) { sum += digit; } else { sum += digit - 9; } } else { sum += digit; } } return sum % 10 === 0; }, priority: 32 };