51Testing软件测试论坛

标题: 关于IMEI的CD的算法... [打印本页]

作者: Evan_ma    时间: 2007-3-13 11:04
标题: 关于IMEI的CD的算法...
谁能帮助阐述一下手机IMEI的check digit(CD)的计算方法
有英文的但是没有看懂
Computation of CD from the IMEI proceeds as follows:

Step 1: Double the values of the odd labelled digits D1, D3, D5 ... D13 of the IMEI.

Step 2: Add together the individual digits of all the seven numbers obtained in Step 1, and then add this sum to
the sum of all the even labelled digits D2, D4, D6 ... D14 of the IMEI.

Step 3: If the number obtained in Step 2 ends in 0, then set CD to be 0. If the number obtained in Step 2 does not
end in 0, then set CD to be that number subtracted from the next higher number which does end in 0.

Example of computation
IMEI (14 most significant digits):
                               TAC      FAC                SNR
D14 D13 D12 D11 D10 D9   D8 D7   D6 D5 D4 D3 D2 D1
2    6      0      5    3    1     7   9    3    1   1   3   8   3
Step 1:
2  6 0 5 3 1 7 9 3 1 1 3 8 3
   x2  x2  x2   x2   x2  x2 x2
   12  10   2   18    2   6   6
Step 2:
2 + 1 + 2 + 0 + 1 + 0 + 3 + 2 + 7 + 1 + 8 + 3 + 2 + 1 + 6 + 8 + 6 = 53
Step 3:
CD = 60 - 53 = 7
例子里面的step 2是怎么得来的?
作者: Tender    时间: 2007-3-13 14:19
Step 2: Add together the individual digits of all the seven numbers obtained in Step 1, and then add this sum to
the sum of all the even labelled digits D2, D4, D6 ... D14 of the IMEI

我大概把这句话翻译一下。
把第一步中得到的所有七个数字累加起来,注意是individual digits,也就是说凡是两位数的数字要把十位和个位分开累加,比如是12,那么就是1+2。得到这个和以后,再把这个和与先前标记为D2,D4,D6的数字累加。

D14 D13 D12 D11 D10 D9   D8 D7   D6 D5 D4 D3 D2 D1
2    6      0      5    3    1     7   9    3    1   1   3   8   3
Step 1:
2  6 0 5 3 1 7 9 3 1 1 3 8 3
   x2  x2  x2   x2   x2  x2 x2
   12  10   2   18    2   6   6
Step 2:
2 + 1 + 2 + 0 + 1 + 0 + 3 + 2 + 7 + 1 + 8 + 3 + 2 + 1 + 6 + 8 + 6 = 53
Step 3:
CD = 60 - 53 = 7

从右到左,6是D1的3X2,8是D2,依此类推,到D7的时候,应该是9X2=18,所以分开1+8,后面凡是涉及到两位数的都是如此。楼主一看便知。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2