1 / 6

模檢數(modulo check)

模檢數(modulo check). 算法的一種 用於檢查一個數字的有效性 例子 15789 ,權數 ﹕{6,5,4,3,2} ,模數 ﹕7 1x6 , 5x5 , 7x4 , 8x3 , 9x2 6+25+28+24+18 = 101 101÷7 = 14……3 檢查數位 = 7( 模數 ) – 3( 餘數 ) = 4 結果 15789 4. 模檢數(modulo check). 234 ,權數 ﹕{4,3,2} ,模數 ﹕7 1237 ,權數 ﹕{5,4,3,2} ,模數 ﹕7 特別例子 ﹕239 ,權數 ﹕{4,3,2} ,模數 ﹕7

brick
Download Presentation

模檢數(modulo check)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 模檢數(modulo check) • 算法的一種 • 用於檢查一個數字的有效性 • 例子 • 15789 ,權數﹕{6,5,4,3,2},模數﹕7 • 1x6,5x5,7x4,8x3,9x2 • 6+25+28+24+18 = 101 • 101÷7 = 14……3 • 檢查數位 = 7(模數) – 3(餘數) = 4 • 結果157894

  2. 模檢數(modulo check) • 234,權數﹕{4,3,2},模數﹕7 • 1237,權數﹕{5,4,3,2},模數﹕7 • 特別例子﹕239,權數﹕{4,3,2},模數﹕7 • 2x4+3x3+9x2 = 35 • 35÷7 = 5……0 • 檢查數位 = 0 • 結果2390

  3. 檢查數位(check digit) • 計算ISBN檢查數位 • 總和  除以11  11 - 餘數  檢查數位 • 以下的檢查數位﹖ 962-943-654-? 962-943-872-?

  4. 檢查數位(check digit) • 計算HKID檢查數位 • A :1,B:2,….. • 總和  除以11  11 - 餘數  檢查數位 • 以下的檢查數位﹖ E723423(?) G723423(?)

  5. 檢查數位(check digit) • 校驗ISBN檢查數位 • 模11 • 總和能被11整除 – 有效的 • 以下哪個是有效﹖ 962-943-811-5 962-943-811-7 962-943-811-9

  6. 檢查數位(check digit) • 校驗HKID檢查數位 • 模11 • 總和能被11整除 – 有效的 • A :1,B:2,….. • 以下哪個是有效﹖無效﹖ E723423(4) G723423(2) B234234(6)

More Related