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 ...
随机推荐
- linux命令:rsync
Rsync的命令格式可以为以下六种: rsync [OPTION]... SRC DEST rsync [OPTION]... SRC [USER@]HOST:DEST rsync [OPTION]. ...
- codevs-1205
1205 单词翻转 题目描述 Description 给出一个英语句子,希望你把句子里的单词顺序都翻转过来 输入描述 Input Description 输入包括一个英语句子. 输出描述 Output ...
- ** Error in `./g2o_viewer': realloc(): invalid pointer:
问题: defe@defe-Precision-Tower-3620:~/project/Demo/UseG2OforPoseGraph/useg2oforposegraph$ ./g2o_viewe ...
- 20个Flutter实例视频教程-01节底部导航栏和切换效果的制作-1
视频地址: https://www.bilibili.com/video/av39709290?zw 博客地址: https://jspang.com/post/flutterDemo.html#to ...
- PHP文件操作功能函数大全
PHP文件操作功能函数大全 <?php /* 转换字节大小 */ function transByte($size){ $arr=array("B","KB&quo ...
- 一个IP绑定多个域名的实现方法
方案一: 文字叙述: 具体步骤如下:比如讲apache服务器127.0.0.1 配置成 www.sohu.com 首先在http.conf文件中 做如下处理: ①关闭默认的 #DocumentRoot ...
- Flink window机制
此文已由作者岳猛授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 问题 window是解决流计算中的什么问题? 怎么划分window?有哪几种window?window与时间属 ...
- Dapper的正确使用姿势
本文demo适用于MySQL Dapper优势和缺点 优点 高性能.易排查.易运维.灵活可控 缺点 和EF相比,手写sql当修改表结构不易发现bug. 习惯了EF后再来使用Dapper,会很难适应那种 ...
- HDU4247【瞎搞】
题意: 给你4个小正方形的边长,让你求一个最小大正方形的边长以至于可以存这么四个正方形. 思路: 比划了一下...就是最大边+次大边,因为他们一定有交集. #include <cstdio> ...
- 洛谷 P4704 太极剑【贪心】
首先考虑分割线能分割一条线当且仅当分割线一个端点在这条线的ab中间,另一端点在外面,也就是分割线对应的一条弧不能同时有这条线的两个端点 每条线的两端点都染同色,然后分段,一段里面颜色互不相同,分割线就 ...