aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-27 02:05:20 +0900
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-27 02:05:20 +0900
commitcc85a1ee7108a4190217d67676bbc83d505f5a3a (patch)
tree70246e692cd4a64798d14e9e8df98be7d00cebad
parent2322c1f9ffb17bdd09e35d1c1d66947c1f324726 (diff)
utils: Zero-pad MCC and MNC in enc_plmn()
-rw-r--r--pySim/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pySim/utils.py b/pySim/utils.py
index 17dc693..757394f 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -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])