mirror of
https://github.com/srlabs/blue-merle.git
synced 2024-10-01 00:55:39 -04:00
Added IMEI character length validation check in
imei_generate.py which ensures IMEI has 14-char length, including validation digit
This commit is contained in:
parent
09d2f8c087
commit
187378a1d6
@ -141,6 +141,10 @@ def generate_imei(imei_prefix, imsi_d):
|
|||||||
|
|
||||||
|
|
||||||
def validate_imei(imei):
|
def validate_imei(imei):
|
||||||
|
# before anything check if length is 14 characters
|
||||||
|
if len(imei) != 14:
|
||||||
|
print(f"NOT A VALID IMEI: {imei} - IMEI must be 14 characters in length")
|
||||||
|
return False
|
||||||
# cut off last digit
|
# cut off last digit
|
||||||
validation_digit = int(imei[-1])
|
validation_digit = int(imei[-1])
|
||||||
imei_verify = imei[0:14]
|
imei_verify = imei[0:14]
|
||||||
|
Loading…
Reference in New Issue
Block a user