Skip to content

Instantly share code, notes, and snippets.

@morsisko
Last active May 5, 2017 13:19
Show Gist options
  • Save morsisko/cb41188e8299b29d6034ec278611fe04 to your computer and use it in GitHub Desktop.
Save morsisko/cb41188e8299b29d6034ec278611fe04 to your computer and use it in GitHub Desktop.
Gynvael's Livestream #38 - propozycja rozwiązania zadania
#Python 3.5.2
base64table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
gynTable = ["QW==", "QT==", "QT==", "QQ==", "QU==", "Qd==", "QU==", "Qd==",
"QX==", "QV==", "QW==", "Qe==", "QT==", "QR==", "QU==", "QT==",
"QT==", "QU==", "QX==", "QU==", "QT==", "QR==", "QT==", "QQ==",
"QW==", "Qe=="]
for i in range(0, len(gynTable) - 1, 2):
left = (base64table.index(gynTable[i][1]) & 0xF) << 4
right = base64table.index(gynTable[i+1][1]) & 0xF
print(chr(left+right), end="")
#result: c0MMun1C4t10n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment