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. 【Linux学习】Linux文件系统6—文件目录权限设置

    Linux文件系统6-文件目录权限设置 1.       chmod操作权限设置 chomd是用来改变文件或目录权限的命令,但只有文件的属主和超级权限用户root才有这种权限.通过chmod来改变文件 ...

  2. 深入理解Java中方法的参数传递机制

    形参和实参 我们知道,在Java中定义方法时,是可以定义参数的,比如: public static void main(String[] args){ } 这里的args就是一个字符串数组类型的参数. ...

  3. IOS11 - UINavigationItem大标题,搜索栏实现

    1.新建模型 class Contact: NSObject { var name : String? var mobile : String?{ didSet{ { mobileString = m ...

  4. IT兄弟连 JavaWeb教程 JSP经典案例

    案例需求:定义一个javaBean叫XdlUser,有四个字段int id.String name.int age.double salary.写一个jsp页面,在页面中构建一个列表对象,里面存放几个 ...

  5. 渗透测试之无文件渗透简单使用-windows

    无文件渗透测试工作原理:无文件恶意程序最初是由卡巴斯基在2014年发现的,一直不算是什么主流的攻击方式,直到此次事件的发生.说起来无文件恶意程序并不会为了执行而将文件或文件夹复制到硬盘上,反而是将pa ...

  6. python 函数 之 用户注册register()

    db_path='db.txt' #定义默认文件路径,方便修改def get_uname(): while True: uname=input('请输入用户名:').strip() if uname. ...

  7. 【Linux】Devops的一些运维工具

    一.Devops简介 从手工编译.上传服务器文件.执行命令.启动停止服务器.发现BUG再重复一遍流程,软件开发的重复劳动越来越多,在Devops概念之前,全部要靠人工手动完成,也看到了很多运维人员半夜 ...

  8. 【微服务】Dubbo初体验

    一.前言 之前微服务这块只用过SpringCloud搭建,但是最近面试会被问到dubbo框架,虽然之前也学了但是都忘了,故写此博客加深印象. 二.原理简介 Dubbo是一个分布式服务框架,以及阿里巴巴 ...

  9. JSP | 基础 | 中文字符的传递

    设置传递格式: request.setCharacterEncoding("utf-8"); 中文字符解码: import java.net.URLDecoder; String ...

  10. ZROI 普及组模拟赛02总结

    ZROI 普及组模拟赛02总结 先放[网址][http://zhengruioi.com/contest/96] 可能是有一段时间没有打这种正式的比赛了,今天打的很奇怪... T1 模拟水题 既然是普 ...