Skip to content

Instantly share code, notes, and snippets.

@Ge0rg3
Created September 23, 2018 16:04
Show Gist options
  • Save Ge0rg3/b0a9e7656417d3e325746e4ab86e313f to your computer and use it in GitHub Desktop.
Save Ge0rg3/b0a9e7656417d3e325746e4ab86e313f to your computer and use it in GitHub Desktop.
Part of the Reply Challenge 2018 Practice Challenges.
import hashlib
descrambled = []
concword = ""
with open('scrambled-words.txt','r') as f:
scrambledwords = f.read().split()
with open('dictionary.txt','r') as f:
dictionary = f.read().split()
def checkSame(s,l):
if (sorted(s) == sorted(l)) and (len(s) == len(l)):
return True
else:
return False
for word in scrambledwords:
for dictw in dictionary:
dictw = list(dictw)
if (checkSame(word,dictw) == True):
descrambled.append(dictw)
break
for i in descrambled:
concword += (''.join(i))
print("{FLG:"+hashlib.sha256(concword.lower()).hexdigest()+"}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment