Skip to content

Instantly share code, notes, and snippets.

@philikon
Created June 14, 2011 18:54
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 philikon/1025581 to your computer and use it in GitHub Desktop.
Save philikon/1025581 to your computer and use it in GitHub Desktop.
Convert email address to Sync username
#!/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