抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >


Python Base

Base.py
import base64
def base64codes():
s = input()
b64encode = base64.b64encode(s.encode(encoding='utf-8'))
b32encode = base64.b32encode(s.encode(encoding='utf-8'))
b16encode = base64.b16encode(s.encode(encoding='utf-8'))
print(b64encode.decode(encoding='utf-8'))
print(b32encode.decode(encoding='utf-8'))
print(b16encode.decode(encoding='utf-8'))
print('---------------------------------')
try:
b64decode = base64.b64decode(s.encode(encoding='utf-8'))
print(b64decode.decode(encoding='utf-8'))
except Exception as e:
print("",end="")
try:
b32decode = base64.b32decode(s.encode(encoding='utf-8'))
print(b32decode.decode(encoding='utf-8'))
except Exception as e:
print("",end="")
try:
b16decode = base64.b16decode(s.encode(encoding='utf-8'))
print(b16decode.decode(encoding='utf-8'))
except Exception as e:
print("",end="")
if __name__ == '__main__':
try:
while True:
base64codes()
except EOFError:
exit()
推荐阅读
Python Baconian Python Baconian Python ASCII 字符串 转换 Python ASCII 字符串 转换 Python MD5 Python MD5 Python RailFenceCipher Python RailFenceCipher Python Morse Python Morse Python BinaryConversion Python BinaryConversion

留言区

Are You A Robot?