Server IP : 150.95.80.236 / Your IP : 3.14.130.45 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/assets/plugins/formvalidation/dist/es6/validators/id/ |
Upload File : |
import t from"../../utils/isValidDate";export default function e(e){if(!/^\d{10}$/.test(e)&&!/^\d{6}\s\d{3}\s\d{1}$/.test(e)){return{meta:{},valid:false}}const s=e.replace(/\s/g,"");let r=parseInt(s.substr(0,2),10)+1900;let a=parseInt(s.substr(2,2),10);const l=parseInt(s.substr(4,2),10);if(a>40){r+=100;a-=40}else if(a>20){r-=100;a-=20}if(!t(r,a,l)){return{meta:{},valid:false}}let i=0;const n=[2,4,8,5,10,9,7,3,6];for(let t=0;t<9;t++){i+=parseInt(s.charAt(t),10)*n[t]}i=i%11%10;return{meta:{},valid:`${i}`===s.substr(9,1)}}