$ python3 enctest.py
Input Certificate Serial Number:
> 03:4A:72:43:1B:35:86:E7:D1:F9:22:2B:03:F6:9E:15:3E:54
Base64: A0pyQxs1hufR+SIrA/aeFT5U
Base85: 14?p38#RXK(fJ}P1NNR3K2!
Created
August 3, 2019 09:57
-
-
Save zezic/2ba23b35e153f76ecf6b3c966d7acb70 to your computer and use it in GitHub Desktop.
Text Encoding Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import binascii | |
import string | |
while True: | |
print('Input Certificate Serial Number:') | |
text_bytes = bytes.fromhex(''.join([ | |
char for char in input('> ') | |
if char in string.hexdigits | |
])) | |
print('Base64:', base64.b64encode(text_bytes).decode('utf-8')) | |
print('Base85:', base64.b85encode(text_bytes).decode('utf-8')) | |
print('') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment