Created
March 27, 2017 01:34
-
-
Save mattbasta/cfb788d737b27f72747742a189645c16 to your computer and use it in GitHub Desktop.
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
import hashlib | |
ADJECTIVES = { | |
'0': 'Ancient', | |
'1': 'Breezy', | |
'2': 'Charming', | |
'3': 'Delightful', | |
'4': 'Exuberant', | |
'5': 'Fantastic', | |
'6': 'Jolly', | |
'7': 'Lively', | |
'8': 'Magnificent', | |
'9': 'Outrageous', | |
'A': 'Pleasant', | |
'B': 'Robust', | |
'C': 'Splendid', | |
'D': 'Thoughtful', | |
'E': 'Victorious', | |
'F': 'Zany', | |
} | |
NOUNS = { | |
'0': 'Piccolo', | |
'1': 'Toaster', | |
'2': 'Sandwich', | |
'3': 'Traveler', | |
'4': 'Dragon', | |
'5': 'Ninja', | |
'6': 'Superhero', | |
'7': 'Rainbow', | |
'8': 'Suitcase', | |
'9': 'Alligator', | |
'A': 'Isotope', | |
'B': 'Asymptote', | |
'C': 'Compiler', | |
'D': 'Soup', | |
'E': 'Droid', | |
'F': 'Constellation', | |
} | |
def get_anonymous_name(email): | |
h = hashlib.md5(email.encode('utf-8')).hexdigest() | |
return 'Anonymous %s %s' % (ADJECTIVES[h[0].upper()], NOUNS[h[1].upper()]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment