codecombat/scripts/mongodb/queries/email-sha1s.py

11 lines
264 B
Python
Raw Normal View History

2015-09-18 08:02:18 -04:00
from __future__ import with_statement
import hashlib
with open("user_emails.txt", "r") as f:
emails = f.read().strip().split('\n')
sha1s = [hashlib.sha1(e).hexdigest() for e in emails]
with open("user_sha1s.txt", "w") as f:
f.write("\n".join(sha1s) + "\n")