Last active
May 18, 2021 20:28
-
-
Save walison17/8b0139bce92a61db1bfbaea75f84df7c to your computer and use it in GitHub Desktop.
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 obfuscate_email(email): | |
username, delimiter, domain = email.partition('@') | |
obfuscated = f'{username[:2]}{"*" * (len(username) - 4)}{username[-2:]}' | |
return f'{obfuscated}{delimiter}{domain}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment