Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import base64
with open("test.jpg", "rb") as imageFile:
str = base64.b64encode(imageFile.read())
print(str)
decoded = base64.decodebytes(str)
print(decoded)
print(len(decoded)*8)
print("".join(["{:08b}".format(x) for x in decoded]))
binaryNude = "".join(["{:08b}".format(x) for x in decoded])
with open("face_test_b64.txt", "w") as text_file:
print("{}".format(str), file=text_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.