CDMA Hardware Identifiers - ESN, MEID, pESN

Introduction

CDMA systems require a (mostly) unique identifier for mobile devices. This identifier is specific to the device, and can't (easily) be changed, unlike a phone number (also known as a "MIN"). There are two major identifier types - the older Electronic Serial Number (ESN) and the newer Mobile Equipment Identifier (MEID). Both identifiers have multiple presentation formats, and it can be tricky to determine how to actually identify a device if you're given a number in an unknown format. This document aims to demystify ESNs and MEIDs.

Electronic Serial Number (ESN)

ESNs are managed by the Telecom Industry Association. They are 32 bits long (that is, they can be described by a sequence of 32 1's and 0's), and identify the manufacturer of a mobile device and also the serial number assigned to the device by that manufacturer.

The basic format for ESNs consists of 8 bits to specify the manufacturer and 24 bits to specify the serial number:

The 8 bits of the manufacturer portion lead to 256 (2^8) different possible manufacturer codes. Some codes are reserved, however: numbers 0 through 18, 128, 250, and 255 are not to be used as normal ESNs.

For manufacturer codes 0 through 17, 250, and 255, the manufacturer code is 14 bits and the serial number is 18 bits.

Code 128 is discussed below in the pESN section.

It's usually most convenient to assume the standard format, and treat the reserved codes as exceptions.

The 32 binary bits can be expressed in several ways, but the two recognized ways are:

To convert between the two, break up your code (in either format) into a manufacturer block and a serial number block, convert the block to/from decimal/hex separately, then concatenate the two blocks. Make sure the blocks start and end with the correct number of hex characters/decimal digits.

Some improper, but not-uncommon ways of representing ESNs are:

Mobile Equipment Identifier (MEID)

MEIDs are also manged by the TIA. These are 56 bits long, and like ESN's, identify the manufacturer of a mobile device as well as the serial number assigned to the device by that manufacturer.

The MEID consists of 32 bits to specify the manufacturer and 24 bits to specify the serial number: The first 4 bits of the manufacturer code are "reserved," and restricted to just a few values. There can also be a 4 bit "check digit" appended to the end, but this is not transmitted between the mobile device and the CDMA system (according to 3GPP2 S.R0048-A) and is not common to see.

There are two proper ways to represent MEIDs:

To convert between the two, break up your code (in either format) into a manufacturer block and a serial number block, convert the block to/from decimal/hex separately, then concatenate the two blocks. Make sure the blocks start and end with the correct number of hex characters/decimal digits.

Some improper, but not-uncommon ways of representing MEIDs are:

Tip: For MEIDs, it can be difficult to convert to/from hex/decimal an improper code, since the numbers are so large (they cause an error if the "integer" type used in whatever conversion routine is not big enough).

Resources for MEIDs:

Pseudo ESN (pESN)

The reserved ESN manufacturer code 128 is for "pseudo ESNs," which allow legacy equipment to recognize MEIDs. pESNs are ESN codes that always begin with 0x80 in the hex format (or 128 in the decimal format, but it is much more convenient to work with the hex format for pESNs). To generate one, you apply the Secure Hash Algorithm 1 (SHA-1) to the MEID, and take the last (least significant) 24 bits (6 hex numbers) of the result, and append them to 0x80.

This can be tricky to do, especially if you're using something like Microsoft Excel. You want to apply SHA-1 to the number representing the MEID, not the string representing the MEID. You'll need to process it byte-by-byte, so you must give it two hex numbers at a time (since two hex numbers make a byte) and make sure they are interpreted as numbers and not ASCII characters.

Examples: