aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpySim-prog.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pySim-prog.py b/pySim-prog.py
index 942cfb0..e172d80 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -225,8 +225,9 @@ def parse_options():
def _digits(secret, usage, len, num):
- s = hashlib.sha1(secret + usage + '%d' % num)
- d = ''.join(['%02d'%ord(x) for x in s.digest()])
+ seed = secret + usage + '%d' % num
+ s = hashlib.sha1(seed.encode())
+ d = ''.join(['%02d' % x for x in s.digest()])
return d[0:len]
def _mcc_mnc_digits(mcc, mnc):