First Import Base64
>>> import base64
Encoding in Base64
>>> string = "test" >>> >>> base64_string = base64.b64encode(f'{string}'.encode("ascii")).decode("ascii") >>> base64_string 'dGVzdA=='
Decoding in Base64
>>> base64_decoded = base64.b64decode(f'{base64_string}'.encode("ascii")).decode('ascii') >>> base64_decoded 'test'
Comments
Post a Comment