Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python2 snippet for taking a base64-encoded unicode string, and decoding it properly so there aren't trailing null bytes on ASCII characters
#!/usr/bin/env python
"""
Python2 snippet for taking a base64-encoded unicode string, decoding it
properly so there aren't trailing null bytes for ASCII characters
Leaving this here so I don't have to look it up again
@decidedlygray
"""
import base64
b64_str = "ADD BASE64 UNICODE STRING HERE"
b64_str_decoded = base64.b64decode(b64_str).decode('UTF-16')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.