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. Google浏览器如何加载本地文件

    Chrome浏览器加载本地文件 一般来说,为了安全起见,浏览器是不能通过load方法来加载本地文件的,load方法只能加载远程服务器上的文件. 在浏览器默认的情况下,试图加载一个本地文件,会出现交叉域 ...

  2. 3-3if-else条件结构 & 3-4 & 3-5

    新建类: ConditionDemo2 package com.imooc.operator; public class ConditionDemo2 { public static void mai ...

  3. PHP中的常用正则表达式集锦

    PHP中的常用正则表达式集锦: 匹配中文字符的正则表达式: [\u4e00-\u9fa5] 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 匹配双字节字符(包括汉字在内):[^\x00-\xf ...

  4. LuaToC#

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. 浅谈SpringBoot核心注解原理

    SpringBoot核心注解原理 今天跟大家来探讨下SpringBoot的核心注解@SpringBootApplication以及run方法,理解下springBoot为什么不需要XML,达到零配置 ...

  6. 我叫mt3.0更新公告

    1.增加卡牌: (1)炮姐,种族:牛头人,职业:元素萨满,可在任务中使用万能碎片兑换,最多兑换5张: (2)娘子,种族:德莱尼人,职业:治疗萨满,进化材料为死亡视察者: 详情点击查看>>& ...

  7. 跳跃表&hash

    汇编刚学跳跃表,发现跳跃表与hash有着数不清的关系 维基百科: 哈希表(哈希映射)是实现关联数组抽象数据类型的数据结构,该结构可以将键映射到值.哈希表使用哈希函数来计算桶或槽阵列的索引,从中可以找到 ...

  8. Mysql用户root密码找回

    1.本试例的环境如下: 2.mysql数据库的版本如下,此数据库运行多实例: mysql Ver 15.1 Distrib 10.2.24-MariaDB, for Linux (x86_64) us ...

  9. 原来TextBox打开了MultiLine之后就不能使用AutoComplete了

    private void Form1_Load(object sender, EventArgs e) { // Create the list to use as the custom source ...

  10. Python标准库time

    原文:http://www.cnblogs.com/qq78292959/archive/2013/03/22/2975786.html Python官方文档 在程序中,免不了和时间打交道,要学习ti ...