Skip to content

Instantly share code, notes, and snippets.

@mattbasta
Created March 27, 2017 01:34
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 mattbasta/cfb788d737b27f72747742a189645c16 to your computer and use it in GitHub Desktop.
Save mattbasta/cfb788d737b27f72747742a189645c16 to your computer and use it in GitHub Desktop.
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