I have a base64-encoded nonce as a 24-character string:
nonce = "azRzAi5rm1ry/l0drnz1vw=="
And I want a 16-byte int:
0x6b3473022e6b9b5af2fe5d1dae7cf5bf
My best attempt:
from base64 import b64decode
b64decode(nonce)
>> b'k4s\x02.k\x9bZ\xf2\xfe]\x1d\xae|\xf5\xbf'
How can I get an integer from the base64 string?
binascii.hexlify(b64decode(nonce))
or in Python3,b64decode(nonce).hex()
. – Hawsepipe