Dec-06-2018, 03:45 PM
That's just a semantics issue, of the library being particular about what you give it. Calling
.encode()
on the hex string will convert it to a bytes string. They'll have the same content, but it'll be a "bytes" to make the library happy.>>> import base64 >>> key = 'RLhdtbhVbFXUeqZh6jm0t5ToI6b4IGbac8R2EkP+Ido=' >>> text = base64.b64decode(key).hex() >>> text '44b85db5b8556c55d47aa661ea39b4b794e823a6f82066da73c4761243fe21da' >>> text.encode() b'44b85db5b8556c55d47aa661ea39b4b794e823a6f82066da73c4761243fe21da'