correctly compute the ICCID (19 digits, including luhn checksum)

This commit is contained in:
Harald Welte
2011-12-07 12:34:13 +01:00
committed by Sylvain Munaut
parent 5dffefbf0c
commit 2c0ff3a167
2 changed files with 12 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ class Card(object):
self._scc = scc
def _e_iccid(self, iccid):
return swap_nibbles(iccid)
return swap_nibbles(rpad(iccid, 20))
def _e_imsi(self, imsi):
"""Converts a string imsi into the value of the EF"""