This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//身分證字號或外籍人士居留証驗證 | |
/* | |
* 第一個字元代表地區,轉換方式為:A轉換成1,0兩個字元,B轉換成1,1……但是Z、I、O分別轉換為33、34、35 | |
* 第二個字元代表性別,1代表男性,2代表女性 | |
* 第三個字元到第九個字元為流水號碼。 | |
* 第十個字元為檢查號碼。 | |
* 每個相對應的數字相乘,如A123456789代表1、0、1、2、3、4、5、6、7、8,相對應乘上1987654321,再相加。 | |
* 相加後的值除以模數,也就是10,取餘數再以模數10減去餘數,若等於檢查碼,則驗證通過 | |
*/ | |
function studIdNumberIdentify(nationality, idNumber){ |