Skip to content

Instantly share code, notes, and snippets.

@dasmer
Created November 27, 2019 19:50
Show Gist options
  • Save dasmer/02b7d9dd11eeef96642039a71f17d8b0 to your computer and use it in GitHub Desktop.
Save dasmer/02b7d9dd11eeef96642039a71f17d8b0 to your computer and use it in GitHub Desktop.
Secret Santa Encrypted Name URL Creator
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