Skip to content

Instantly share code, notes, and snippets.

@MartinLuksik
Created March 9, 2022 07:28
Show Gist options
  • Save MartinLuksik/8dbcdea82312ddde5e78437e7b31f8b1 to your computer and use it in GitHub Desktop.
Save MartinLuksik/8dbcdea82312ddde5e78437e7b31f8b1 to your computer and use it in GitHub Desktop.
[Python] #python
def base_encode(self, secret_value):
"""
Return base64 encoded string
"""
message_bytes = secret_value.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')
return base64_message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment