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
- Multiply each digit in the NRIC number by its weight.
- Add together the above products.
- Divide the resulting sum by 11.
- Subtract the remainder from 11 to give the check digit.
- 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的更多相关文章
- 2292: Quality of Check Digits 中南多校 暴力枚举
#include <cstdio> #include <algorithm> #include <cstring> #include <iostream> ...
- Oracle Global Finanicals Technical Reference(一个)
Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11 ...
- Oracle Global Finanicals Technical Reference(一)
Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11 ...
- 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 ...
- 通用js函数集锦<来源于网络/自己> 【一】
通用js函数集锦<来源于网络/自己>[一] 1.返回一个全地址2.cookie3.验证用户浏览器是否是微信浏览器4.验证用户浏览器是否是微博内置浏览器5.query string6.验证用 ...
- business knowledge
Finance knowledge Trading---At the core of our business model is Trading, which involves the buying ...
- jQuery Validate 表单验证
在做网页表单时时常需要在客户端对表单填写的数据进行验证一番才能提交,我们可以通过自己编写JavasScript代码来验证,但是有时数据量过多时就会有些难度了.基于jQuery的jquery.valid ...
- jquery.validate插件在booststarp中的运用
现在在网络上已经可以找到很多基于bootstarp的表单认证,但是验证的都不全面的,下载后,我们还要理解作者的思路然后进行修改添加,这种修改方式往往适合学习,时间很多的时候.但是我们很多时候是没有时间 ...
- 身份证js验证
<script type="text/javascript"> //--身份证号码验证-支持新的带x身份证 function isIdCardNo(num) { var ...
随机推荐
- Hadoop 源代码组织结构
Hadoop 2.X 包括 编译好的可以直接部署的文件hadoop-{VERSION}.tar.gz; 还有源代码文件hadoop-{VERSION}-src.tar.gz , 需要 Maven 编译 ...
- python数据分析笔记中panda(2)
1 将手机号码分开为运营商,地区和号码段 from pandas import read_csv; df = read_csv("H:\\pythonCode\\4.6\\data.csv& ...
- HDU2824【欧拉函数性质】
思路: 打表. 利用公式. 类似素数打表一样. #include<bits/stdc++.h> using namespace std; const int N=3e6+10; bool ...
- [Xcode 实际操作]一、博主领进门-(6)Xcode的iOS模拟器的基本使用方法
目录:[Swift]Xcode实际操作 本文将演示Xcode的iOS模拟器的基本使用方法. 在项目导航区,鼠标右键[Assets.xcassets]资源文件夹. 隔壁右侧区域左下角点击[+],打开资源 ...
- Luogu P1514引水入城【搜索】 By cellur925
题目传送门 这道题开始看好像并没有什么思路,和搜索好像也并没有什么关系.但是我们手玩下样例就会发现,思路其实就三句话:(写这道题的时候在代码里写的) //我们想知道从第1行的每列往下到干旱区的范围 / ...
- NPOI用WorkbookFactory读写 2007以上格式文件(xlsx)
//我用的最新的2.2.1版本 //第一步:引用DLL,5个全导入,包括ICSHARP.ZIP,是个开源压缩工具包.XLSX是压缩格式,需要它来解压 //第二部: using NPOI.SS.User ...
- 基于java开发的在线题库系统tamguo
简介 探果网(简称tamguo)是基于java开发的在线题库系统,包括 在线访问 后台运营 会员中心 书籍中心 管理员账号:system 密码:123456 因为线上数据和测试数据没有做到隔离,作者已 ...
- 学习java设计模式的必要性探讨
1.设计模式是什么:设计模式为我们提供了一套可复用的面向对象技术,再配合重构方法,可以让我们避免简单重复的工作.它使用面向接口编程,而不是面向实现.可以说设计模式是java程序设计的灵魂. 2.为什么 ...
- Expert Python programming - Reading Notes
1. MRO: method resolution order lookup order: L(MyClass) = [MyClass, merged(L(Base1), L(Base2), Base ...
- Springboot日志配置探索(主要看logback)(一)
这篇博客是springboot日志配置探索的第一篇,主要讲默认配置下springboot的logback日志框架的配置(即直接使用是怎样的) 首先,是一个SpringBoot的有关日志的说明文档:ht ...