Created
November 27, 2019 19:50
-
-
Save dasmer/02b7d9dd11eeef96642039a71f17d8b0 to your computer and use it in GitHub Desktop.
Secret Santa Encrypted Name URL Creator
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
import base64 | |
from urllib.parse import quote | |
def secret_santa_url(input_string): | |
# Base64 Encoding | |
encodedBytes = base64.b64encode(input_string.encode("utf-8")) | |
encodedStr = str(encodedBytes, "utf-8") | |
# URL Encoding Encoding | |
url_b64_encoded_str = quote(encodedStr.encode('utf8')) | |
# Append to URL String | |
url_string = "https://dasmer.com/secret-santa?p=" + url_b64_encoded_str | |
return url_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment