utils: Zero-pad MCC and MNC in enc_plmn()

Change-Id: I94607f6a87a416d05bd577a29d1466452921d604
This commit is contained in:
Alexander Chemeris 2018-01-27 02:05:20 +09:00
parent 2322c1f9ff
commit cc85a1ee71
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ def enc_iccid(iccid):
def enc_plmn(mcc, mnc):
"""Converts integer MCC/MNC into 3 bytes for EF"""
return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3))
return swap_nibbles(lpad('%03d' % mcc, 3) + lpad('%02d' % mnc, 3))
def dec_spn(ef):
byte1 = int(ef[0:2])