0

How can I know if a string is ascii format and whiche base like: base64,or base32 ... with python I tried

import base64
from binascii import Error
try:
        string = base64.b64decode(data)
except Error:
        return False

the problem with this code that's it isn't accurate and doesn't tell which base is the string

ali filali
  • 86
  • 1
  • 6
  • 1
    It's not even valid syntactically. What are you trying to do here? Could you give some inputs and expected vs actual outputs? – jonrsharpe Jan 19 '20 at 18:29
  • you mean like [this](https://stackoverflow.com/questions/436220/how-to-determine-the-encoding-of-text)? – MrFuppes Jan 19 '20 at 18:55
  • the input is a string and output is whether the string is encoded in binascii and which base Hope i explained thank you :) – ali filali Jan 19 '20 at 20:18

0 Answers0