Server IP : 150.95.80.236 / Your IP : 18.191.223.239 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/plugins/formvalidation/dist/amd/validators/ |
Upload File : |
define(["require", "exports", "../algorithms/luhn"], function (require, exports, luhn_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function meid() { return { validate: function (input) { if (input.value === '') { return { valid: true }; } var v = input.value; if (/^[0-9A-F]{15}$/i.test(v) || /^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}[- ][0-9A-F]$/i.test(v) || /^\d{19}$/.test(v) || /^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}[- ]\d$/.test(v)) { var cd = v.charAt(v.length - 1).toUpperCase(); v = v.replace(/[- ]/g, ''); if (v.match(/^\d*$/i)) { return { valid: (0, luhn_1.default)(v) }; } v = v.slice(0, -1); var checkDigit = ''; var i = void 0; for (i = 1; i <= 13; i += 2) { checkDigit += (parseInt(v.charAt(i), 16) * 2).toString(16); } var sum = 0; for (i = 0; i < checkDigit.length; i++) { sum += parseInt(checkDigit.charAt(i), 16); } return { valid: sum % 10 === 0 ? cd === '0' : cd === ((Math.floor((sum + 10) / 10) * 10 - sum) * 2).toString(16).toUpperCase(), }; } if (/^[0-9A-F]{14}$/i.test(v) || /^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}$/i.test(v) || /^\d{18}$/.test(v) || /^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}$/.test(v)) { return { valid: true }; } return { valid: false }; }, }; } exports.default = meid; });