Base64 in Python

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

Encode

import base64
binary_data = ...
c = base64.b64encode(binary_data).decode('utf-8')

Decode

import base64
base64_text = ...
binary_data = base64.b64decode(base64_text)