mirror of
https://github.com/srlabs/blue-merle.git
synced 2024-12-22 05:44:59 -05: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):
|
||||
# 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
|
||||
validation_digit = int(imei[-1])
|
||||
imei_verify = imei[0:14]
|
||||
|
Loading…
Reference in New Issue
Block a user