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. Product it again

    题意:求解 $$\prod_{1 \leq i \leq n} \prod_{1 \leq j \leq m} {(i,j)}$$ 解法: 满脑子的反演 考虑对于第一个质数 $p$ 的贡献为 $p^{ ...

  2. 安装java之后,找不到tools.jar 和dt.jar

    可能很多初学者和我一样,在初次接触java开发的过程中,急于看到最终的结果,匆匆在网上下载了jdk之后,点击安装,结果等安装完,开始配置classpath时,发现jdk/lib下面根本就没有 tool ...

  3. CF-799B

    B. T-shirt buying time limit per test 3 seconds memory limit per test 256 megabytes input standard i ...

  4. Qt .pro文件配置大全!

    避免以后的无意义重复劳动,将用过的所有的头文件库文件的配置都放在这里,以后要用的话直接copy就好. eigen3: INCLUDEPATH += \ /usr/local/include/eigen ...

  5. 红帽系统制作yum本地源

    1 首先得吐槽吐槽,机房冷就算了,不能用手机(哈哈你懂的),没有站的位置,显示屏看不清楚.就这样开始制作yum本地源. 2 记下注意得两点,以防以后会忘记 a:可能是因为红帽系统,加上是实用光盘挂载的 ...

  6. 微信小程序开发之修改和获取变量的值

    在小程序开发过程中有两种变量,一种是定义在app,js里面的globalData定义的全局变量,另一种是在各个页面app,data里面的定义的变量. 一:全局变量的定义,获取值,赋值,修改 app.j ...

  7. Java的多线程创建方法

    1. 直接使用Thread来创建 package com.test.tt; public class ThreadEx extends Thread{ private int j; public vo ...

  8. Swift3.0 Alamofire网络请求的封装(get,post,upload图片上传)转

    转自: http://blog.csdn.net/C_calary/article/details/53193747 学习Swift 试着动手写个天气小app,搜集资料这个封装还蛮好用的. 我用的第三 ...

  9. Linux下mysql启动失败

    原因:强制重启服务器之后,发现mysql启动 失败 解决方法:强制清空 报错路径下的tmp文件,清空之后在tmp下面新建一个文件夹,文件夹的名字在你清空tmp之后启动mysql系统会给你提示 欧克,完 ...

  10. bzoj 3653: 谈笑风生【dfs序+主席树】

    考虑b的两种情况,一种是p的祖先,这种点有min(k,de[p]-1)个,然后每个这种b都有si[p]-1个c点可选: 另一种是p的子孙,要求是在p的子树内且deep在de[p]+1~de[p]+k之 ...