mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-11-07 18:26:18 +03:00
utils: Zero-pad MCC and MNC in enc_plmn()
Change-Id: I94607f6a87a416d05bd577a29d1466452921d604
This commit is contained in:
1 parent
2322c1f9ff
commit
cc85a1ee71
1 file changed
+1
-1
+1
-1
@@ -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])
|
||||
|
||||
Reference in new issue
Block a user