Decodify
Decodify copied to clipboard
add support for Base32 decoding
it's quite common, and can be identified with 1 trailing =, instead of 2 =s used in its Base64 counterpart.
in Python, base64.b32decode can be used to perform the decoding.
Base64 doesn't always end with a = . Can you please elaborate on how to differentiate between them?
You can look here for reference.
Base64
Base64 has the advantage of generating shorter representations because it uses a 64 character set instead of hexadecimal's 16. While Base 64 can use any 64 characters, many implementations follow IETF PEM RFC 1421 which specifies A-Z, a-z, 0-9, / and + while using = for padding.
Base32
Base32, as defined in IETF RFC 3548, uses the characters A-Z and 2-7.
So, essentially, what you could look for is if the string includes any of the numbers 0, 1, 8, 9 and that should be enough to rule out the string being base32-encoded.
try: and except may work better to implement as there probably are cases where it would detect as 64 but is actually a 32?
@3lixy We will decode for both ;)