MEID (Mobile Equipment Identifier).
The Mobile Equipment Identifier is used to identify a physical piece of CDMA mobile station equipment.
>>> validate('AF 01 23 45 0A BC DE C')
'AF0123450ABCDE'
>>> validate('29360 87365 0070 3710 0')
'AF0123450ABCDE'
>>> validate('29360 87365 0070 3710 1')
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> format('af0123450abcDEC', add_check_digit=True)
'AF 01 23 45 0A BC DE C'
>>> format('af0123450abcDEC', format='dec', add_check_digit=True)
'29360 87365 0070 3710 0'
Calculate the check digit for the number. The number should not already have a check digit.
Convert the MEID number to the minimal (hexadecimal) representation. This strips grouping information, removes surrounding whitespace and converts to hexadecimal if needed. If the check digit is to be preserved and conversion is done a new check digit is recalculated.
Reformat the passed number to the standard format. The separator used can be provided. If the format is specified (either ‘hex’ or ‘dec’) the number is reformatted in that format, otherwise the current representation is kept. If add_check_digit is True a check digit will be added if it is not present yet.
Checks to see if the number provided is a valid MEID number.
Convert the number to it’s binary representation (without the check digit).
Convert the provided MEID to a pseudo ESN (pESN). The ESN is returned in compact hexadecimal representation.
Checks to see if the number provided is a valid MEID number. This converts the representation format of the number (if it is decimal it is not converted to hexadecimal).