Message ID | 20201025105605.5692-2-jeremy.006@gmail.com |
---|---|
State | New |
Headers | show |
Series | pysim: make random seed function python3 compatible | expand |
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):