• The Singapore NRIC Check Digit


    The Singapore NRIC number is made up of 7 digits and a letter behind. This letter is calculated from the first 7 digits using the modulus eleven method, similar to the method used for calculating the check digit of the ISBN Code. 

    The steps involved to obtain the check digit is

    1. Multiply each digit in the NRIC number by its weight.
    2. Add together the above products.
    3. Divide the resulting sum by 11.
    4. Subtract the remainder from 11 to give the check digit.
    5. Check the check digit against the table to obtain the alphabet.

    The following table shows the weight for the NRIC number in Singapore :

    2

    7

    6

    5

    4

    3

    2

    The following table is used to change the check digit into the corresponding alphabet.

    Check Digit

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    Alphabet

    A

    B

    C

    D

    E

    F

    G

    H

    I

    Z

    J

     

    This system is used to prevent illegal workers from entering Singapore with a fake passport using a fake NRIC number.

     

    A person has a NRIC number S1234567A

     

    To find out if the NRIC number is valid, we need to use the method above.

     

    2(weight)*1(NRIC number) + 7(weight)*2(NRIC number) + 6(weight)*3 + 5*4 + 4*5 + 3*6 + 2*7 = 106

     

    106/11 = 9 r 7

     

    11-7 = 4

     

    Using the table above, if the check digit is 4, then the alphabet at the end of the NRIC number should be D. So, we can conclude that this NRIC number is invalid.

  • 相关阅读:
    ArcGIS10.3.1于2015年6月发布
    jS数组
    正则表达式
    JS中prototype属性-JS原型模式
    URI, URL, and URN
    JS中的Call和apply
    北京获得2022冬奥会举办权
    JQuery.on()事件绑定
    JavaScript模块化-require.js
    SpringBoot中DataSourceAutoConfiguration注解
  • 原文地址:https://www.cnblogs.com/lei1016cn/p/3419169.html
Copyright © 2020-2023  润新知