Monday, August 10, 2009

Mobile Phones T&T -> IMEI checksum

Did you know that that you can check the 15 digits IMEI is valid or not with its checksum?

Yes, you can do it, here is the step :
1. First, take the first 14 digits (the last one, digit #15 is the checksum).
2. For each even digit (digit #2, #4, #6, etc.), multiply it by 2.
3. Sum all the single digit one by one, including the result from step #2. Please note that if the result in step #2 is more than 10, you must separate it to two number, e.g. 17 = 1+7 = 8.
4. Then from the result of step #3, use the following formula :
Checksum = 10 - ([result#3] mod 10)
5. Then compare the Checksum with the digit #15 of the IMEI, if equal, then the IMEI is valid.

Example :
IMEI : 011364005400673
1. first 14 : 01136400540067, checksum=3
2. 0 + (1*2) + 1 + (3*2) + 6 + (4*2) + 0 + (0*2) + 5 + (4*2) + 0 + (0*2) + 6 + (7*2)
3. 0 + 2 + 1 + 6 + 6 + 8 + 0 + 0 + 5 + 8 + 0 + 0 + 6 + (1+4) = 47
4. Checksum = 10 - (47 % 10) = 10 - 7 = 3
5. Checksum = 3, VALID!!!!

Try it by yourself :)

No comments:

Post a Comment