checkBirthDayCode: function(birDayCode){ var check = /^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode); if(!check) returnfalse; var yyyy = parseInt(birDayCode.substring(0,4),10); var mm = parseInt(birDayCode.substring(4,6),10); var dd = parseInt(birDayCode.substring(6),10); var xdata = newDate(yyyy,mm-1,dd); if(xdata > newDate()){ returnfalse;//生日不能大于当前日期 }elseif ( ( xdata.getFullYear() == yyyy ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == dd ) ){ returntrue; }else{ returnfalse; } },
getParityBit: function(idCardNo){ var id17 = idCardNo.substring(0,17); var power = 0; for(var i=0;i<17;i++){ power += parseInt(id17.charAt(i),10) * parseInt(idCardNoUtil.powers[i]); } var mod = power % 11; return idCardNoUtil.parityBit[mod]; },