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 ...
随机推荐
- HDOJ-1251
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submi ...
- 我所理解的Restful API最佳实践
一直在公司负责API数据接口的开发,期间也遇到了不小的坑,本篇博客算是做一个小小的记录. 1. 不要纠结于无意义的规范 在开始本文之前,我想先说这么一句:RESTful 真的很好,但它只是一种软 ...
- 《剑指offer》面试题7—用两个栈实现队列
题目:给出队列声明,要求实现AppendTail和DeleteHead函数. template <typename T>class CQueue{public: void AppendTa ...
- 1090 Highest Price in Supply Chain (25 分)
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone invo ...
- IT兄弟连 JavaWeb教程 Servlet会话跟踪 创建Cookie
Tomcat作为Web服务器,对Cookie提供了良好的支持.那么,运行在Tomcat的Servlet该如何访问Cookie呢?幸运的是,Servlet无需直接和HTTP请求或响应中的原始Cookie ...
- 【OpenJ_Bailian - 4005】拼点游戏(贪心)
拼点游戏 Descriptions: C和S两位同学一起玩拼点游戏.有一堆白色卡牌和一堆蓝色卡牌,每张卡牌上写了一个整数点数.C随机抽取n张白色卡牌,S随机抽取n张蓝色卡牌,他们进行n回合拼点,每次两 ...
- canvas+js实现时钟效果图
<! DOCTYPE html> <html> <head> <title>Clock</title> </head> < ...
- Info.plist配置相关文件访问权限
<key>NSAppleMusicUsageDescription</key> <string>App需要您的同意,才能访问媒体资料库</string> ...
- [软件工程基础]2017.11.01 第五次 Scrum 会议
具体事项 燃尽图 每人工作内容 成员 已完成的工作 计划完成的工作 工作中遇到的困难 游心 #8 掌握 Laravel 框架 #10 搭建可用的开发测试环境:#9 阅读分析 PhyLab 后端代码与文 ...
- 洛谷 P3830 [SHOI2012]随机树
https://www.luogu.org/problemnew/show/P3830 具体方法见代码.. 其实挺神奇的,概率可以先算出“前缀和”(A小于等于xxx的概率),然后再“差分”得到A恰好为 ...