Last active
November 4, 2015 11:24
-
-
Save idlesign/4b3f25582df4e694e911 to your computer and use it in GitHub Desktop.
Data size growth for various base64 module functions.
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
from base64 import * | |
with open('/home/idle/binary.data', 'rb') as f: | |
data = f.read() | |
for method in [b64encode, b32encode, b16encode, a85encode, b85encode]: | |
percent = ((len(method(data)) * 100) / len(data)) - 100 | |
print('%s: +%s%%' % (method.__name__, round(percent, 2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: