沙特 Iqama/国民身份证号码字段验证 [英] Saudi Iqama/National Identity number field validation

查看:84
本文介绍了沙特 Iqama/国民身份证号码字段验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我制定沙特 iqama/国民身份证号码的现场验证标准吗?

Can someone help me with the criteria for field validation for Saudi iqama/National Identification number?

我知道对于国民来说,它应该从 1 开始,对于外籍人士,它应该从 2 开始,长度应该是 10.其他任何东西.这是针对已经看到一些不良传入数据产生错误的应用程序,所以不要冒险.提前致谢.

I know for Nationals it should start with 1 and for expats, it should start with 2 and the length should be 10.Anything else. This is for an application which has already seen some bad incoming data creating bugs, so don't want to take chances. Thanks in advance.

推荐答案

For (Id Type='National Id')  length = 10 , Id Number must start with '1' in position 1. 乘以奇数中的每个数字位置(位置 1,3,5..9 中的字符)乘以 2.如果乘法产生 2 位数,则将这 2 位数相加以产生一位数.将 ID 号的前 9 个字符相加(乘法后)以产生 2 位数字 (XY).如果身份证号的第10位数字等于零",则将前9个字符的总和中第2位(Y)的数字减去10,得到2位数字(ZN),(N)应等于身份证号码的第 10 位数字.否则,ID Number的第10位数字应等于前9个字符总和中位置2(Y)的数字减去10.

For (Id Type=’National Id’)  length = 10 , Id Number must start with ‘1’ in position 1. Multiply every number in an Odd Position (characters in positions 1,3,5..9) by 2. If the multiplication yields a 2 digit number then summate these 2 digits to yield a single digit. Summate the first 9 Characters for the ID number (post multiplication) to yield a 2 digit number (XY). If 10th digit of the ID number equals to "Zero", then subtract 10 by the digit in position 2 (Y) in the summation total of the first 9 characters to yield a 2 digits (ZN), (N) should be equal to the 10th digit of the ID Number. Else, the 10th digit of the ID Number should be equal to 10 subtracted by the digit in position 2 (Y) in the Summation total of the first 9 Characters.

这篇关于沙特 Iqama/国民身份证号码字段验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆