Skip to content

Instantly share code, notes, and snippets.

@45deg
Created September 27, 2015 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 45deg/a648e56769b2465bf14b to your computer and use it in GitHub Desktop.
Save 45deg/a648e56769b2465bf14b to your computer and use it in GitHub Desktop.
import random
import string
import sys
import base64
alphabets = string.lowercase + string.uppercase
base64s = set(alphabets + '0123456789' + '+' + '/')
appeared = set()
for i in range(100000):
for LEN in range(1,9):
stra = ''
strb = ''
for i in range(LEN):
stra += random.choice(alphabets)
strb += random.choice(alphabets)
if stra == strb:
continue
stra = base64.b64encode(stra)
strb = base64.b64encode(strb)
for a, b in zip(stra, strb):
if a == b:
appeared.add(a)
print ''.join(sorted(base64s - appeared))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment