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.

The Singapore NRIC Check Digit的更多相关文章

  1. 2292: Quality of Check Digits 中南多校 暴力枚举

    #include <cstdio> #include <algorithm> #include <cstring> #include <iostream> ...

  2. Oracle Global Finanicals Technical Reference(一个)

    Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11 ...

  3. Oracle Global Finanicals Technical Reference(一)

    Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11 ...

  4. Awesome Go精选的Go框架,库和软件的精选清单.A curated list of awesome Go frameworks, libraries and software

    Awesome Go      financial support to Awesome Go A curated list of awesome Go frameworks, libraries a ...

  5. 通用js函数集锦<来源于网络/自己> 【一】

    通用js函数集锦<来源于网络/自己>[一] 1.返回一个全地址2.cookie3.验证用户浏览器是否是微信浏览器4.验证用户浏览器是否是微博内置浏览器5.query string6.验证用 ...

  6. business knowledge

    Finance knowledge Trading---At the core of our business model is Trading, which involves the buying ...

  7. jQuery Validate 表单验证

    在做网页表单时时常需要在客户端对表单填写的数据进行验证一番才能提交,我们可以通过自己编写JavasScript代码来验证,但是有时数据量过多时就会有些难度了.基于jQuery的jquery.valid ...

  8. jquery.validate插件在booststarp中的运用

    现在在网络上已经可以找到很多基于bootstarp的表单认证,但是验证的都不全面的,下载后,我们还要理解作者的思路然后进行修改添加,这种修改方式往往适合学习,时间很多的时候.但是我们很多时候是没有时间 ...

  9. 身份证js验证

    <script type="text/javascript"> //--身份证号码验证-支持新的带x身份证 function isIdCardNo(num) { var ...

随机推荐

  1. 算法导论17:摊还分析学习笔记(KMP复杂度证明)

    在摊还分析中,通过求数据结构的一系列的操作的平均时间,来评价操作的代价.这样,即使这些操作中的某个单一操作的代价很高,也可以证明平均代价很低.摊还分析不涉及概率,它可以保证最坏情况下每个操作的平均性能 ...

  2. web开发并部署到Tomcat上

    1. eclipse配置tomcat https://jingyan.baidu.com/article/e4d08ffdabb0710fd2f60de9.html https://blog.csdn ...

  3. 安装openstack出现的问题及解决

    感谢http://www.cnblogs.com/nmap/p/6417163.html,参考这篇文章,我在虚拟机上部署成功了,后来因为虚拟机实在带不动,所以改装到物理机上,在实验室找到两台物理机,分 ...

  4. python数据分析笔记中panda(2)

    1 将手机号码分开为运营商,地区和号码段 from pandas import read_csv; df = read_csv("H:\\pythonCode\\4.6\\data.csv& ...

  5. 01.课程介绍 & 02.最小可行化产品MVP

    01.课程介绍 02.最小可行化产品MVP 产品开发过程 最小化和可用之间找到一个平衡点

  6. classpath 和 classpath*的 区别:

    classpath 和 classpath*的 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径 ...

  7. gSoap学习笔记

    http://www.cnblogs.com/xiangism/archive/2012/11/14/2770242.html http://www.cnblogs.com/lvkun/archive ...

  8. uoj#282. 长度测量鸡(构造)

    传送门 打表题--只有\(n\leq 3\)有解否则无解→_→ 或者严格证明的话是这样,因为算上端点一共\(n+1\)个点,共\(\frac{n(n+1)}{2}\)个点对,所以点对之间两两距离不相等 ...

  9. Kibana: Unknown error while connecting to Elasticsearch

    如果访问不通,可能是网络代理的问题,注意查看/etc/profile中是否设置了相关的代理. 注意修改代理后,应该执行 . /etc/profile 使配置文件立即生效.

  10. C - 不要62

    #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> ...