mirror of https://gerrit.osmocom.org/pysim
make random seed function python3 compatible
Change-Id: Iea8c93c20abe080eeb18026faeeb2668664871bb
This commit is contained in:
parent
95ec772b61
commit
3b00dbf0d2
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue