Created
June 14, 2011 18:54
-
-
Save philikon/1025581 to your computer and use it in GitHub Desktop.
Convert email address to Sync username
This file contains hidden or 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
#!/bin/env python | |
import base64 | |
import hashlib | |
import sys | |
if len(sys.argv) < 2: | |
print >>sys.stderr, "Usage: %s <email address>" % sys.argv[0] | |
sys.exit(1) | |
email = sys.argv[1].lower() | |
hashed = hashlib.sha1(email).digest() | |
print base64.b32encode(hashed).lower() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment