Use bytearray for pbkdf2

This commit is contained in:
JonnyWong16 2019-11-24 14:50:30 -08:00
parent 5f722570d2
commit e6be03a770

View file

@ -66,7 +66,7 @@ def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None):
def _pseudorandom(x, mac=mac):
h = mac.copy()
h.update(x)
return list(map(ord, h.digest()))
return bytearray(h.digest())
buf = []
for block in range(1, -(-keylen // mac.digest_size) + 1):
rv = u = _pseudorandom(salt + _pack_int(block))