Last active
September 22, 2015 08:18
-
-
Save nateluzod/ef82aec7ac659af082cd to your computer and use it in GitHub Desktop.
Mask an email address to show only the first letter of the name and the domain. Could be modified to work the same for credit card numbers.
This file contains 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
def scrub_email(email): | |
""" Takes an email address and masks the left side. test@test.com becomes t***@test.com """ | |
user, domain = email.split('@') | |
user = user[0].ljust(len(user), "*") | |
return("{}@{}".format(user, domain)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment