轉換為 base64:
base64 轉換回文字:
文章撰寫中...請稍後...
import base64
input = "Hello, World!"
# 轉換為 bytes
encoded_bytes = base64.b64encode(input.encode('utf-8'))
# 轉換為字串
encoded_str = encoded_bytes.decode('utf-8')
print(f"Base64:{encoded_str}")
base64 轉換回文字:
import base64
input = "SGVsbG8sIFdvcmxkIQ=="
# 轉換為 bytes
decoded_bytes = base64.b64decode(input)
# 轉換為字串
decoded_str = decoded_bytes.decode('utf-8')
print(f"原始內容:{decoded_str}")
文章撰寫中...請稍後...
留言
張貼留言
如果有任何問題、建議、想說的話或文章題目推薦,都歡迎留言或來信: a@ruyut.com