記一次 身份證號解析工具類

2021-09-24 06:45:49 字數 1308 閱讀 2470

import moment from 'moment'

export default idnumber

*/getbirthbyidnumber(idnumber, format = 'yyyy-mm-dd') ,

/***

* 根據身份證號獲取 出生年份

* @author hsc

* @date 2018-11-12

* @param idnumber

*/getyearbyidnumber(idnumber) ,

/***

* 根據身份證獲取出生月份

* @author hsc

* @date 2018-11-12

* @param idnumber

*/getmonthbyidnumber(idnumber) ,

/***

* 根據身份證編號獲取 距離當前時間 的月數

* @author hsc

* @date 2018-11-12

* @param idnumber

* @returns

*/getmonthsagebyidnumber(idnumber) ,

/***

*根據身份編號獲取號 獲取年齡

* @author hsc

* @date 2018-11-12

* @param idnumber

*/getagebyidnumber(idnumber) ,

/***

*根據身份編號獲取生日天

* @author hsc

* @date 2018-11-12

* @param idnumber

*/getdaybyidnumber(idnumber) ,

/***

* 根據身份證獲取性別

* @author hsc

* @date 2018-11-12

* @param idnumber

*/getgenderbyidnumber(idnumber) else

}return sgender

},/**

** 檢查是否是正確的身份證格式

* @author hsc

* @date 2018-11-12

* @param idnumber

*/checkidnumber(idnumber) [0-9]$|^[1-9][0-9]([0-9]|[xx])$/

return reg.test(idnumber)

}}複製**

js驗證解析身份證號

idvalidate.js 身份證15位編碼規則 dddddd yymmdd xx p dddddd 地區碼 yymmdd 出生年月日 xx 順序類編碼,無法確定 p 性別,奇數為男,偶數為女 身份證18位編碼規則 dddddd yyyymmdd y dddddd 地區碼 yyyymmdd 出生年月...

身份證號檢測工具

身份證號知識大講堂 1.現在的身份證號都是18位的,每一位都有自己所代表的含義,具體如下 1 前1 2位數字表示 所在省份的 2 第3 4位數字表示 所在城市的 3 第5 6位數字表示 所在區縣的 4 第7 14位數字表示 出生年 月 日 5 第15 16位數字表示 順序碼,表示在同一位址碼所標識的...

C 身份證識別(一) 身份證號定位

一 影象預處理 public static imagebyte binimg image byte img 二 身份證號區域提取 獲取輪廓 private static vectorofvectorofpoint getcontours imagebyte pic 篩選矩形 public stati...