I am having some trouble converting this Python 2 code:
import md5
steamid=76561197960435530
temp = ""
for i in range(8):
temp += chr((steamid & 0xFF))
steamid >>= 8
m = md5.new("BE"+temp)
print m.hexdigest()
into Python 3, the result from the code above is 'a071c58205ec529c5c19fa7dadcaae93'. However, when I try to reproduce the same code in Python 3 using the hashlib library, I get a completely different return. I want it to return the exact same thing as the Python 2 code. Here is my attempt to reproduce the code in Python 3:
from hashlib import md5
steamid = 76561197960435530
temp = ""
for i in range(8):
temp += chr((steamid & 0xFF))
steamid >>= 8
m = md5()
m.update(("BE"+temp).encode())
print(m.hexdigest())
which returns 'a96d4d4b56a3b5c1a747e01dd7045c6d' which is not what I want it to return.