Calculate the IMEI checkpoint and the IMEI checkpoint

Source: Internet
Author: User

Calculate the IMEI checkpoint and the IMEI checkpoint

Calculate the IMEI checkpoint

The International Mobile device Identification Number (IMEI: International Mobile Equipment Identification Number) is a unique identifier of a Mobile device. It is attached to the logo on the back of the Mobile phone and stored in the Mobile device, it can be used to monitor stolen or invalid mobile devices. It is also the "file" and "ID card number" of the mobile phone in the manufacturer ". IMEI codes are centrally allocated by the GSM (Global Mobile Communications Association) and authorized to be reviewed by BABT (UK communications Certification Board. the total length is 15 digits, and each digit only uses 0 ~ 9 ).

IMEI consists of 15 digits, which are:

  • 1. The first six digits (TAC, Type ApprovalCode) are "model approval numbers", which generally represent models.
  • 2. The next two digits (FAC, Final Assembly Code) are "last Assembly numbers", which generally represent the origin.
  • 3. the next 6 digits (SNR) are "serial numbers", which generally represent the production sequence numbers.
  • 4. the last 1-digit (SP) is usually "0", which is the Verification Code and is used as an alternative.

IMEI verification code algorithm:

  • (1) multiply the number of even digits by 2 to calculate the sum of single digits and ten digits respectively.
  • (2) Add the odd digit number and the value calculated in the previous step.
  • (3). If the number of digits obtained is 0, the check bit is 0. Otherwise, the value is 10 minus the single digit.

For example: 35 89 01 80 69 72 41 even digits multiply by 2 get 5*2 = 10 9*2 = 18 1*2 = 02 0*2 = 00 9*2 = 18 2*2 = 04 1*2 = 02, calculate the sum of odd digits and even digits. 3 + (1 + 0) + 8 + (1 + 8) + 0 + (0 + 2) + 8 + (0 + 0) + 6 + (1 + 8) + 7 + (0 + 4) + 4 + (0 + 2) = 63 => check bits 10-3 = 7

Char GetIMEICheckDigit (char * pp_Imei) {int I; int vl_Sum1 = 0, vl_Sum2 = 0, vl_Total = 0; int vl_Temp = 0; for (I = 0; I <14; I ++) {/* (1) Add odd digits (count from 1) */if (I % 2) = 0) {vl_Sum1 = vl_Sum1 + pp_Imei [I]-'0';} else {/* (2) Multiply the even number by 2, respectively, calculate the sum of single digits and ten digits (counting from 1) */vl_Temp = (pp_Imei [I]-'0') * 2; if (vl_Temp <10) {vl_Sum2 = vl_Sum2 + vl_Temp;} else {vl_Sum2 = vl_Sum2 + 1 + vl_Temp-10 ;}}/ * (1) + (2) */vl_Total = vl_Sum1 + vl_Sum2; /* if the number of digits obtained is 0, the check bit is 0. Otherwise, the value is 10 minus the single digit */if (vl_Total % 10) = 0) {return '0 ';} else {return (char) (10-(vl_Total % 10) + '0 ');}}


How can I calculate the IMEI verification code?

IMEI verification code algorithm:
(1) multiply the number of even digits by 2 to calculate the sum of single digits and ten digits respectively.
(2) Add the odd digit number and the value calculated in the previous step.
(3). If the number of digits obtained is 0, the check bit is 0. Otherwise, the value is 10 minus the single digit.
For example: 35 89 01 80 69 72 41 even digits multiply by 2 get 5*2 = 10 9*2 = 18 1*2 = 02 0*2 = 00 9*2 = 18 2*2 = 04 1*2 = 02, calculate the sum of odd digits and even digits. 3 + (1 + 0) + 8 + (1 + 8) + 0 + (0 + 2) + 8 + (0 + 0) + 6 + (1 + 8) + 7 + (0 + 4) + 4 + (0 + 2) = 63 => check bits 10-3 = 7
 
How does labvIEW implement programming for imei checkpoint calculation?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.