Skip to content

Instantly share code, notes, and snippets.

@NguyenDa18
Created March 10, 2022 23:33
Show Gist options
  • Save NguyenDa18/2aabb01bcaa4c4071d49d98164b1e66c to your computer and use it in GitHub Desktop.
Save NguyenDa18/2aabb01bcaa4c4071d49d98164b1e66c to your computer and use it in GitHub Desktop.
Base64 Encoding/Decoding String with Python
import base64
encoded_string = base64.b64encode(bytes(string, 'utf-8'))
# source: https://stackoverflow.com/questions/21478086/how-to-store-binary-data-in-dynamo-with-boto
email_addreses = [base64.b64decode(item['EmailAddress'].value).decode('utf-8') for item in queried_items]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment