jeudi 29 janvier 2015

Python3 Base64 decode of a var containing ==


Vote count:

0




So Ive got a string of:

YDNhZip1cDg1YWg4cCFoKg==

that needs to be decoded using Pythons Base64 module.


Ive written the code



import base64

test = 'YDNhZip1cDg1YWg4cCFoKg=='
print(test)
print(base64.b64decode(test))


which gives the answer

b'`3afup85ah8p!h'

when, according to the website decoders Ive used, its really


`3afup85ah8p!h


Im guessing that its decoding the additional quotes.

Is there some way that I can save this variable with a delimiter, as another type of variable, or run the b64encode on a section of the string as slice doesnt seem to work?



asked 2 mins ago







Python3 Base64 decode of a var containing ==

Aucun commentaire:

Enregistrer un commentaire